For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
          • Overview
          • Store values in variables
          • Create and use environments
          • Set environment variables
          • Manage team environments
          • Environment colors
          • Pinned environments
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Edit environment variables
  • Edit variables from the variables pane
  • Set environment variables from scripts
Use PostmanSend requestsVariables and environments

Edit and set environment variables in Postman

||View as Markdown|
Was this page helpful?
Previous

Group sets of variables in Postman using environments

Next

Work with environments as a team in Postman

Built with

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.

Edit environment variables

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 filter the list of environment variables by name or value, click Search icon Search, and enter your search.
  • To sort the list of environment variables, select a column header. You can toggle between ascending and descending order. To manually sort the list, clear the sort order if needed by selecting a column header, then drag rows using the handles.
  • To add a new environment variable, click Add variable in the bottom row of the table.
  • To delete an environment variable, hover over a variable and click Delete icon Delete.
  • To make an environment variable unavailable without deleting it, clear the checkbox next to the variable. Any references to the variable will be empty variables without a value. To make the variable available again, select the checkbox.

Environment editor

To edit an environment variable, select the variable and change any of the following:

  • Variable - The name of the variable. Use the name to reference the variable in requests and scripts.
  • Sensitive data - Click Key icon Mark as sensitive next to the variable name to set the variable as sensitive data, masking the value in Postman. Learn more about setting a variable as sensitive data.
  • Value - This value is used when sending requests in your local instance of Postman. It’s never synced to the Postman cloud or shared with your team. You can optionally share the environment variable’s value, syncing it with the Postman cloud.

Changes to your variables are automatically saved.

Edit variables from the variables pane

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 click Variable list icon 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.

Set environment variables from scripts

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:

1pm.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.