Environments & Variables
Variables let you reuse values — base URLs, tokens, account IDs, anything — across many requests without retyping them. Define a value once, reference it with {{name}}, and HTTPBot fills it in every time you send the request.
This is the backbone of working efficiently in HTTPBot: point the same set of requests at staging or production by flipping a single switch, keep secrets out of your request bodies, and share Collections without baking in environment-specific details.
How variables work
HTTPBot uses Mustache-style templates. Anywhere a value is accepted, wrap a variable name in double curly braces:
{{variable}}
When you send a request, HTTPBot replaces each {{variable}} with its current value. You can reference variables in just about every field of a request:
- The URL, including query parameters and path variables
- Headers
- The request body (raw / JSON, form data, URL-encoded, and GraphQL variables)
- Authentication fields — usernames, tokens, client IDs/secrets, keys, and more (see Authentication)
A typical URL might look like this:
https://{{baseUrl}}/users/{{userId}}
With baseUrl set to api.staging.example.com and userId set to 42, HTTPBot sends the request to https://api.staging.example.com/users/42. Change the value of baseUrl in one place and every request that uses it follows along.



You can combine static text and variables freely, and you can use more than one variable in a single field. Path variables (the :id style segments) are also resolved against your variables before the request is sent.
Scopes & precedence
HTTPBot resolves a {{variable}} by looking through three scopes. If the same name exists in more than one scope, the more specific scope wins.
| Scope | Where it lives | Applies to |
|---|---|---|
| Global Variables | Settings → Global Variables | Every request, app-wide |
| Collection variables | Defined on a Collection | Requests inside that Collection |
| Environment | The currently active Environment | Every request, while that Environment is active |
When a request is sent, the scopes are merged in this order, with each later scope overriding earlier ones:
- Global Variables are applied first.
- Collection variables for the request's Collection are applied next, overriding any Global Variable of the same name.
- The active Environment's variables are applied last, overriding both.
In other words: an active Environment beats a Collection variable, and a Collection variable beats a Global Variable. This lets you set a sensible default globally (or on a Collection) and then override it for a specific environment such as Staging or Production.



Global Variables
Global Variables are always in effect, regardless of which Environment is active or which Collection a request belongs to. They're a good home for values that rarely change — a default API host, a shared API version header, or a feature flag you toggle occasionally.
Open them from Settings → Global Variables, or from a request's … menu → Environment → Global Variables. Each entry is a key/value pair.
Collection variables
A Collection can carry its own variables, scoped to the requests inside it. These are handy when a set of requests shares a value that doesn't belong to your whole app — for example, a resource ID used only by one API's endpoints. See Collections & Folders for where to edit them.
Environments
An Environment is a named set of variables you can activate and deactivate. Only one Environment is active at a time, and its values override Global and Collection variables while it's active. Switching Environments is the fastest way to repoint the same requests at a different server or account.
Each Environment is simply a list of key/value pairs — for example a Staging Environment and a Production Environment that each define baseUrl, apiKey, and userId with different values.
HTTPBot keeps two kinds of Environments:
- Local Environments — created and stored on your device.
- Postman Environments — Environments synced from a connected Postman account. They appear once you've linked Postman (see Postman Sync) and refresh from the cloud.



Creating and editing an Environment
- Open the Environments list — from a request's
…menu → Environment → Manage Environments, or from Settings → Environments. - Tap the + button and choose New Environment.
- Give it a name (for example,
Staging). - Add key/value pairs — one row per variable.
- Save.
To edit an Environment later, reopen the list and select it. You can also import Environments from a file or from Postman using the + menu in the Environments list.
Switching the active Environment
You can activate an Environment in two places:
- From a request's
…menu → Environment. The menu lists your Local and Postman Environments; tap one to make it active. The currently active Environment is shown at the top, where you can also Edit it or Deactivate it. - From Settings → Environments. Manage the full list and pick the one you want.
When an Environment is active, every request resolves its {{variables}} against that Environment first. To stop using any Environment, choose Deactivate from the request … menu → Environment. With no Environment active, requests fall back to Collection and Global Variables only.



Tips
- Keep secrets in an Environment. Put tokens and keys in an Environment (or Global Variables) and reference them with
{{token}}. Your requests stay clean and you can swap credentials without editing each request. - Name variables consistently. If every Environment defines the same keys (
baseUrl,apiKey, …), switching Environments "just works" for all your requests. - Use Collection variables for Collection-specific values. Reserve Environments for things that change between servers/accounts, and Collection variables for values tied to one API.
- Override precisely. Define a default globally, then override only the keys that differ in a given Environment.
Related
- Building a Request — where to type
{{variables}}in a request - Authentication — using variables in auth fields and Saved Credentials
- Collections & Folders — Collection-level variables
- Postman Sync — bringing in Postman Environments