An environment is a group of variables whose values you can change depending on your work context in Postman. After you create an environment, you can add new environment variables, update their values, or delete variables. You can also set environment values using scripts, and you can share variable values to make them available to your team.
You can edit environment variables by adding new variables, changing a variable's value, marking a value as sensitive data, or deleting variables.
If you're working with environments as part of a team, you must have the Editor role to edit the environment and its values. Learn more about sharing environments.
To edit environment variables, select Environments in the sidebar and select an environment. From here you can take the following actions:
To edit an environment variable, select the variable and change any of the following:
Changes to your variables are automatically saved.
Use the variables pane to view and edit the local value for variables in the active environment. You can view the environment variables used in the request that's open. You can also view the environment variables in the active environment from a Postman element.
Choose an environment from the environment selector, then select Variables to open the variables pane. Delete the existing value of an environment variable, then enter a new value.
You can also hover over the reference to the environment variable, delete the existing value, then enter a new value.
Learn more about viewing and editing variables from an element.
You can change the values of environment variables from your Pre-request and Post-response scripts. Use the pm.environment
method to set an environment variable in the active environment:
pm.environment.set("variable_key", "variable_value");
If you use scripts to set values for environment variables, these values will be reflected in all requests that reference the variables. For example, you can use environments in conjunction with the collection runner and monitors to use updated values for a series of requests throughout a run and after the run completes.
To create new environment variables from a script, you must have Editor access to the environment. If you update or unset a value in a script when you have Viewer access, that change will be visible to you but won't be shared with other team members. Learn more about sharing environments.
Last modified: 2025/04/18