Creating and Using Environment & Global Variables
What Are Variables?
Variables let you store values like a base URL, token, or user ID once and reuse them across requests using double curly braces, such as {{base_url}}.
Environment Variables
Environment variables are scoped to a specific environment - for example, Development, Staging, or Production. They're created from the Environments panel and only apply when that environment is selected.
Global Variables
Global variables are available across every environment and collection in a workspace. They're useful for values that never change, regardless of which environment you're testing against.
Variable Scope Priority
| Scope | Availability |
|---|---|
| Local | Single request only |
| Data | Values from a data file during a run |
| Environment | Active environment only |
| Collection | Everywhere the collection is used |
| Global | Entire workspace |
With variables in place, let's see how to organize and switch between multiple environments efficiently.
Ready to master Postman API Testing Course?
Join Uncodemy's hands-on training and build real-world API testing skills with expert mentors.