Environments
An environment is a named set of variables. Pick one in the top-right selector and every {{placeholder}} in your request resolves against it.
What you can put in a variable
Section titled “What you can put in a variable”- Plain strings —
base_url,team_id,version. - Secrets —
api_token,client_secret. Marking an environment variable “secret” masks it in the UI and in collection exports, but the value is still stored as plaintext — environment variables don’t use theSecretRefhandle pattern. Secret variables imported from Postman, Hoppscotch or Bruno environment files keep their value on desktop, but on web and self-host the value is dropped and you re-enter it. For values that need OS-keychain protection, store them on the request’s Auth tab instead (see Authentication), where supported credential fields can be saved as aSecretRefhandle. - Globals — workspace-wide values shared by every request. Edit them under Environments → Globals, or from scripts with
pm.globals/rs.globals. They’re stored as plain values, so keep credentials in environment secrets.
Variable resolution order
Section titled “Variable resolution order”When {{base_url}} is encountered, the most specific scope that defines it wins:
- Data row — the current CSV/JSON row in a collection run.
- Folder variables — the nearest folder first, then outer folders.
- Collection variables — defined in the collection’s settings.
- Active environment — a sub-environment first, then the environment it extends.
- Globals — workspace-wide values.
Pre-request scripts can set environment, collection and global values before the request is sent. If nothing matches, the placeholder is left as-is so you can spot the typo.
pm.environment.set / unset (and rs.environment, postman.setEnvironmentVariable) persist to the active environment, as in Postman: on a single send of an HTTP, GraphQL, gRPC or MCP request, writes from both the pre-request and test scripts are saved when the environment applies to that request (a collection-scoped environment only applies to its own collection’s requests), and during a collection run they are saved to the run’s environment. A variable stored as a desktop secret handle is never overwritten or removed by a script — the key is skipped and a warning names it. A script from a collection writes without asking only to an environment scoped to that collection (or when the request is not in any collection). Writes from a collection’s script to a shared (global) environment are held and Restura asks once per collection and environment: Save stores them and later writes from that collection, Don’t save keeps them for that request or run only — so an imported collection cannot silently redirect your other requests (and the secrets they send). pm.variables stays local to the request or run. In the CLI, environment writes last for the run only; the --env file is not changed.
A variable name is any text without {, } or a line break, trimmed of surrounding whitespace, so {{my key}} and {{ a:b }} both work. An unknown placeholder is left as written. It is only flagged as unresolved when it reads as a plain name; text such as {{#if a}} is treated as ordinary text and not flagged.
Variables that refer to other variables
Section titled “Variables that refer to other variables”In the app, a value that contains {{other}} resolves when other comes later in the variable order. The app walks the variables once, in definition order: request-level values first (in the order they were set), then the active environment’s variables in the order they are listed, then globals. Each variable is substituted over the text so far, so a variable only sees values brought in by variables before it, never the reverse. Reordering the rows can therefore change the result, and a reference cycle simply ends when the walk does.
The CLI and the message bodies of WebSocket, Socket.IO and MQTT sends substitute in a single pass and do not expand a substituted value again. The exception is the CLI’s {{$randomFirstName}}-style helpers: a value of {{$randomFirstName}} still generates there. Streaming sends do not generate helpers that appear inside a variable value. The same collection can therefore resolve a chained value in the app and leave it literal in the CLI; write values that must work in both as complete strings.
Secret variables resolve only where they are written; an alias to one fails the send. Write {{api_token}} in the URL, header, body or auth field itself rather than in another variable’s value. The error names the variable and the field.
To see what a tab actually resolves, open Environments → Variables in scope: it lists every name with its winning value (secrets masked) and the scope it came from.
Switching environments
Section titled “Switching environments”- Top-right environment selector switches in one click.
- New sub-environment creates one that extends the selected environment. An environment that still has sub-environments can’t be deleted: Restura says how many to remove first.
- OWS workflows use their bound saved request’s normal environment resolution; they cannot override environments or write environment variables.
- The CLI accepts
--env <file>to load an environment file (JSON or YAML) for a CI run.
Built-in helpers
Section titled “Built-in helpers”Postman-compatible helpers work in any {{...}} placeholder:
{{$randomUUID}}— fresh UUID per request.{{$timestamp}}— current epoch seconds.{{$isoTimestamp}}— ISO 8601 timestamp.{{$guid}}— alias for$randomUUID.
- Keep secrets out of collection-scope variables — anyone you share an exported collection with sees those values. Mark a collection variable Keep local (in collection settings) to leave it out of every export and of Git sync.
- Use the environment diff view (when staging vs production are open side by side) to spot drift.
Related
Section titled “Related”- Authentication — where supported credentials can be stored as
SecretRefhandles. - Workflows — bounded OWS orchestration over saved HTTP requests; it does not extract or persist environment variables.
- Scripts —
pm.environment.set(...),pm.environment.get(...).