An environment is a set of key-value pairs. The key represents the name of the variable. You can use a data editor to modify an environment.
While working with APIs, you often need different setups for your local machine, the development server, or the production API. Environments let you customize requests using variables so you can easily switch between different setups without changing your requests.
You won’t have to remember all those values once they are in Postman. You can download environments, save them as JSON files, and upload them later.
You can create, share, duplicate, export, and delete an environment. You can also import an environment as a single JSON file.
Environment and global variables are always stored as strings. If you’re storing objects/arrays, be sure to
JSON.stringify()
them before storing, andJSON.parse()
them while retrieving.
You can create a new environment from the:
The Create New tab appears.
Note: At the bottom, you can select “Show this window at launch” to indicate whether you want the Create New tab to display each time you open Postman.
The Create New tab appears by default when you launch Postman.
Note: At the bottom, you can select “Show this window at launch” to indicate whether you want the Create New tab to display each time you open Postman.
Click the dropdown menu in the upper right corner of the Postman app to select an active environment, or type in the environment name.
Once you select an environment, you can access variables in the active environmental scope.
Click the Quick Look icon in the upper right corner of the Postman app to display the environment and global variables.
When you click the Edit link, a modal opens where you can edit keys and values.
To share an environment, click the gear icon in the upper right corner of the Postman app and select “Manage Environments”.
In the Manage Environments tab, click the Duplicate Environment icon next to the environment you want to share.
It’s a best practice to create a duplicate, remove any sensitive values (such as passwords), and access tokens before downloading the copy to share with others.
When others import the environment, or access the shared template, they can input their own personal information in their own version of the template.
For Postman Pro and Enterprise users, learn how to share environment templates with team members.