Variables and environments
Variables avoid repeating values (base URLs, tokens, IDs) and let you switch environments without touching your requests. Write them in double curly braces: {{baseUrl}}.
Scopes and precedence
Section titled “Scopes and precedence”From lowest to highest priority (if two share a name, the lower one in this list wins):
- Globals: for the whole workspace. Environments → Globals.
- Collection: in the collection’s settings → Variables.
- Folder: in the folder’s settings → Variables.
- Environment: the active environment’s.
- Data: the CSV/JSON file columns in the runner.
- Local: created by a script with
pm.variables.set(), lasting only for that run.
Environments
Section titled “Environments”An environment is a named set of variables: Local, Staging, Production…
- Create one in Environments → +.
- Activate it from the top bar selector, the ✓ in the list or Ctrl+K.
- The 👁 icon next to the selector shows the active variables without leaving what you’re doing.
Secret variables
Section titled “Secret variables”Mark a variable as Secret to:
- hide its value on screen (unless you enable “Show secrets”);
- store it encrypted in the database (AES-256-GCM);
- never include it in published documentation or show it to AI assistants.
Variables from scripts
Section titled “Variables from scripts”pm.environment.set('token', pm.response.json().token) // saved to the environmentpm.collectionVariables.set('userId', 42) // saved to the collectionpm.globals.set('lastRun', Date.now()) // saved to globalspm.variables.set('temp', 'x') // only during this runChanges scripts make to environments, collection and globals are saved automatically (if you have edit rights), just like in Postman.
Dynamic variables
Section titled “Dynamic variables”They generate a new value on every send: {{$guid}}, {{$timestamp}}, {{$isoTimestamp}}, {{$randomInt}}, {{$randomEmail}}, {{$randomFirstName}}, {{$randomFullName}}, {{$randomCity}}, {{$randomCompanyName}}, {{$randomLoremSentence}}, {{$randomUUID}}, {{$randomBoolean}}, {{$randomPrice}}… (the same as Postman).