# Editing Shared Environments & Environment Variables

**URL:** <https://community.postman.com/t/editing-shared-environments-environment-variables/443>\
**Category:** Help Hub\
**Tags:** postmanpro, shared\
**Created:** [December 11, 2017, 9:54am UTC](https://community.postman.com/t/editing-shared-environments-environment-variables/443 "2017-12-11T09:54:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![postman-paul540](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/postman-paul540/32/149_2.png) [@postman-paul540](https://community.postman.com/u/postman-paul540)\
**Post date:** [December 11, 2017, 9:54am UTC](https://community.postman.com/t/editing-shared-environments-environment-variables/443/1 "2017-12-11T09:54:15Z")

</div>

**Please Note: Unfortunately, Team Members that are already subscribed to the environment will NOT have their environments updated. They’ll have to delete/re-subscribe to environment until the Postman team make this feature possible.**

**This tutorial is to update a shared environment that’s been used in your CI. (TeamCity, Jenkins etc.)**

Hi,  
This was a question that was asked quite a bit in the Postman Slack and it was something that I always found painful - “How do I edit shared environments/environment variables with my team?”

Unfortunately this isn’t supported through the UI…yet!  
Please +1 the Feature Requests int the Postman Git to show the Postman Team this is something you want 🙂

> <https://github.com/postmanlabs/postman-app-support/issues/2273>
>
> With the new monitoring service this becomes even more important.

So, is there no way to do this at all through Postman?  
Yes, it’s a little cumbersome but it works for me with my shared environments in TeamCity and other Postman Users have confirmed it working.

Get to it already, how do I do this?  
OK! Let’s assume we have envionment shared with a team.  
Using the Postman PRO API, use the GET All Environments request (you’ll need to use your Postman Pro API Key which is unique to you)

GET [https://api.getpostman.com/environments](https://api.getpostman.com/environments)

Remember to use the Postman Pro API Key as a Header.

In the above request you’ll see all your environments, some shared - some not shared.  
Environments that are shared have “.template”. in the “name” field.

 ![image](https://us1.discourse-cdn.com/getpostman/original/1X/eee7a731980bd7ac72554cbd2993c0f84fbe93aa.png)

Take note of the value of the “uid” field.  
In the GET Single Environment request pass in the “uid” as a path parameter

GET [https://api.getpostman.com/environments/{{environmentUID}](https://api.getpostman.com/environments/%7B%7BenvironmentUID%7D)}

Copy the entire response body returned.

Using the PUT Edit Environment request, paste the copied response into the Request Body as raw JSON.

PUT [https://api.getpostman.com/environments/{{environmentUID}](https://api.getpostman.com/environments/%7B%7BenvironmentUID%7D)}

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/7/0/70cc08502087de681354b40d263b41d7b1972503.png)

Make sure you select JSON(application/json) from the dropdown above the body.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/1/d1d758ec7cdb77f01e8f8399170cefb2e154c853.png)

In the request body, edit/delete/add objects inside the ‘values’ array.  
Each object will be an environment variable:

```auto
{
    "environment": {
        "id": "26cce2d3-2d24-2efe-c168-7312ca87f69c",
        "name": "KATA ENV.template",
        "values": [
            {
                "key": "exampleURL",
                "value": "https://www.google.com",
                "type": "text",
                "enabled": true
            },
            {
                "key": "myNewVariable",
                "value": "someTextGoesHere",
                "type": "text",
                "enabled": true
            }
        ]
    }
}

```

Make sure not to change the value of the “id” field.  
If you submit the request you should get a 200 response code and the shared environment should be successfully updated 🙂

In this case, in my shared environment ‘KATA ENV’, I added a new environment variable named ‘myNewVariable’ which has a value of ‘someTextGoesHere’

Assuming there’s a Newman test collection in our CI (In my case, TeamCity) that’s using this shared environment, the shared collection will now have the updated values/variables.

Hopefully there’s some value in this for you guys until this feature is properly supported through the UI.

Feel free to like this post so other users find it 😃

---

<div class="post-metadata">

**Author:** ![kamalaknn](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kamalaknn/32/93_2.png) [@kamalaknn](https://community.postman.com/u/kamalaknn)\
**Post date:** [March 19, 2018, 11:12am UTC](https://community.postman.com/t/editing-shared-environments-environment-variables/443/2 "2018-03-19T11:12:40Z")

</div>

Shared environments are now available in Postman 6.0 🎊

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 2:46pm UTC](https://community.postman.com/t/editing-shared-environments-environment-variables/443/3 "2024-12-12T14:46:55Z")

</div>

Closed on December 12, 2024, 2:46pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
