Skip to content

Environments and Variables

Thiago Miranda edited this page Jun 16, 2026 · 4 revisions

Environments and Variables

Environments let you reuse values (API_HOST, TOKEN, …) across requests and switch between setups (dev / staging / prod) in one click.

Variable syntax

Reference a variable anywhere a value is accepted with double braces:

{{name}}
  • Valid names use letters, digits, _, -, . (and a leading $ for #Dynamic variables).
  • Whitespace inside the braces is ignored: {{ baseUrl }} == {{baseUrl}}.
  • Names are case-sensitive: {{BaseUrl}}baseurl.
  • Unknown variables are left verbatim — a missing {{token}} stays as {{token}} in the request rather than becoming blank, so breakage is visible.

Where variables resolve

At send time, variables are substituted into:

  • the URL (base + query-param values),
  • header values,
  • the body (raw text; urlencoded and multipart field names and values),
  • auth credentials (token / username / password / API-key name & value).

They are not substituted into: header keys, query-param keys, the HTTP method, or file paths.

History keeps the un-resolved request. A history entry stores {{token}}, not the resolved value — so you can re-send it under a different environment. See History.

Managing environments

Open the environment selector (top toolbar) → Manage environments… to open the Environments dialog.

  • Create: click +; you're prompted for a name (CREATE). It starts empty.
  • Edit: select an environment to edit its NAME and VARIABLES (a key/value editor — type in the last row to add another; trash to delete). Changes save immediately.
  • Delete: remove an environment (confirmed). If it was the active one, Getman switches to No Environment automatically.

The active environment

The environment selector shows the current environment (icon + name on wide screens, icon-only on phones). Its menu lists:

  • No Environment (a synthetic "none" option),
  • your environments (a ✓ marks the active one),
  • Manage environments….

Pick one to make it active. With No Environment, only #Dynamic variables resolve; your named variables stay verbatim. The active environment is remembered across restarts.

Quick switch (Cmd/Ctrl + E)

For a keyboard-fast switch without opening the menu, press Cmd/Ctrl + E to open the SWITCH ENVIRONMENT overlay:

  • An arrow-key navigable list of No Environment plus every environment, with the active one marked.
  • ↑ / ↓ moves the highlight (it opens on the currently-active row); Enter or a click switches the active environment; Esc closes without changing anything.

This is a third way to change the active environment, alongside the dropdown selector and the Command Palette (Cmd/Ctrl + K).

Dynamic variables

These built-ins resolve at send time without any environment (a leading $). Each occurrence resolves independently.

Variable Resolves to
{{$guid}} A random v4 UUID
{{$randomUUID}} / {{$randomUuid}} A random v4 UUID (aliases of $guid)
{{$timestamp}} Current Unix time in seconds
{{$isoTimestamp}} Current UTC time, ISO-8601
{{$randomInt}} A random integer 01000

If you define an environment variable with the same name (e.g. timestamp), your variable wins over the built-in.

Secret variables

Mark a variable secret to hide its value:

  • In the variables editor, click a row's lock icon to toggle secret.
  • A secret row's value is masked with a reveal (eye) toggle to peek.
  • Secrets are masked on Postman export (empty value, type: "secret").
  • Send-time resolution is unaffected — a secret resolves like any other variable.
  • Secret flags follow renames and are pruned when a key is deleted.

Live highlighting

In the URL bar (and other variable-aware fields), {{tokens}} are coloured as you type:

  • Resolved (exists in the active environment, or is a dynamic variable) → the "resolved" colour.
  • Unresolved (unknown name) → the "unresolved/warning" colour.

Colours follow the active theme. This makes it obvious at a glance whether a variable will resolve.

Hover to see the resolved value

Hover the mouse over a {{variable}} token — in the URL bar or in a params / headers value field — to see, in a small popover, exactly what it will resolve to under the active environment:

  • Resolved → the value, with a from <Environment> source line.
  • Secret → the value is masked (•••••• (secret)) with an eye toggle to reveal it, so secrets aren't exposed on a casual hover.
  • Dynamic ({{$timestamp}}, {{$guid}}, …) → labelled Generated per request with a freshly-generated sample.
  • UnresolvedNot defined in <Environment>, or No active environment when none is active.

The popover reads the current active environment, so switching environments updates what you see. (Hovering is a desktop/mouse affordance.)

Capturing values automatically

You can extract values from one response into environment variables to chain requests together — see Tests and Chaining.

Clone this wiki locally