*** title: Create and manage environments from the Postman VS Code extension updated: 2025-08-22T00:00:00.000Z max-toc-depth: 2 ---------------- 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](/docs/sending-requests/variables/managing-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.](/docs/sending-requests/variables/managing-environments/#add-environment-variables) 5. Click **Save**. You can also use the `Postman: Create a new Postman Environment` command from the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_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](/docs/sending-requests/variables/managing-environments/#switch-between-environments) in the top-right corner.