Create and manage environments from the Postman VS Code extension

You can add a set of variables to an environment that you can use in your requests. Variables are reusable values you can use in your API requests and scripts. Environments make it easier to change variables based on your work context, such as sending requests to a test or production server. When you switch between environments, all variables in your requests and scripts use the current environment's values.

To learn more about managing environments in Postman, see Group sets of variables in Postman using environments.

Add environment variables

To create an environment and add variables to it, do the following:

  1. Select a workspace from the workspace dropdown list in the sidebar.
  2. Click Environment icon Environments.
  3. Click Add icon.
  4. Add variables to the environment.
  5. Click Save.

You can also use the Postman: Create a new Postman Environment command from the Command Palette to create an environment.

Use environment variables

To use environment variables in a request, do the following:

  1. Click Collection icon Collections.
  2. Select a request.
  3. Select an environment from the environment selector in the top-right corner.

Last modified: 2025/08/22