Skip to content

Environments & variables

Environments are named sets of key/value pairs. Variables let you write a request once and switch context (dev, staging, production) without editing every URL.

Syntax

Use double braces in the URL, headers, and body:

text
{{base_url}}/api/v1/users
{{api_key}}

Resolution happens before the request is sent.

Resolution order

When the same name exists in more than one place, the resolution order is:

  1. Environment variables (active environment) -- highest priority
  2. Collection variables (from the collection or import)
  3. Global variables (user-wide defaults) -- lowest priority

That means you can set defaults at the global or collection level and override per environment.

Enable / disable

Each variable can be enabled or disabled without deleting it — useful for optional headers or experimental flags.

Active environment

Use the environment selector in the toolbar (or equivalent) to pick which environment is active. Only one active environment applies at a time.

Global variables

Gud API also supports global variables (user-wide) where the product exposes them — useful for values you want everywhere unless overridden. Behavior may differ slightly by version; check the sidebar for Globals or similar if available.