# Automatically update shared environment

**URL:** <https://community.postman.com/t/automatically-update-shared-environment/188>\
**Category:** Help Hub\
**Created:** [November 10, 2017, 11:10am UTC](https://community.postman.com/t/automatically-update-shared-environment/188 "2017-11-10T11:10:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Gagneux](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/julien_gagneux/32/66_2.png) [@Julien\_Gagneux](https://community.postman.com/u/Julien_Gagneux)\
**Post date:** [November 10, 2017, 11:10am UTC](https://community.postman.com/t/automatically-update-shared-environment/188/1 "2017-11-10T11:10:11Z")

</div>

Hy postman community.

First thank for your very good app. But something is not good at all.

I want to share environment with mates and i can’t find a way to automatically update my modification to existing environment.

I know, I know, you will answer with this link : [http://blog.getpostman.com/2016/03/10/environment-sharing/](http://blog.getpostman.com/2016/03/10/environment-sharing/)

Well, i know how environment works but my question is : is there a way to automatically update shared environment ?

thanks a lot for reading and more for your answers. \<3

---

<div class="post-metadata">

**Author:** ![abhijitkane1](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/abhijitkane1/32/4_2.png) [@abhijitkane1](https://community.postman.com/u/abhijitkane1)\
**Post date:** [November 10, 2017, 2:13pm UTC](https://community.postman.com/t/automatically-update-shared-environment/188/2 "2017-11-10T14:13:10Z")

</div>

No - for now, environments need to be manually re-shared each time there’s an update. The reason for this is that running pre-request scripts/tests can modify environment variables, and sensitive information like tokens can accidentally leak to team members.

---

<div class="post-metadata">

**Author:** ![Julien\_Gagneux](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/julien_gagneux/32/66_2.png) [@Julien\_Gagneux](https://community.postman.com/u/Julien_Gagneux)\
**Post date:** [November 10, 2017, 2:27pm UTC](https://community.postman.com/t/automatically-update-shared-environment/188/3 "2017-11-10T14:27:22Z")

</div>

Okay, i understand why and it’s a good reason. But may i (by script for example) override this restriction if i want ?

I use Postaman to plan automatic tests at each deployment and i need an up to date environment for my collègues. When we develop our test ours environments changes a lot sometimes.

---

<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 6, 2017, 12:17pm UTC](https://community.postman.com/t/automatically-update-shared-environment/188/4 "2017-12-06T12:17:38Z")

</div>

Although you can’t edit environments that are shared with your team through the UI, I believe you can edit the shared environment through the Postman Pro API.

[https://docs.api.getpostman.com/](https://docs.api.getpostman.com/)

```auto
// Hit the below GET request in Postman whilst passing in your Postman Pro API Key as a header.
https://api.getpostman.com/environments
//Grab the UID linked to the environment you want to edit.
// (Note: The shared environments have ".template" at the end)

// Then hit the below GET request passing your UID for the given environment you want to edit.
https://api.getpostman.com/environments/{{environment_uid}}
// Copy the entire JSON response returned from this response.

// Then hit the below PUT request, but pass in the entire JSON body from the previous endpoint in the Body as raw JSON.
// Feel free to change any of the values in 'values' array
https://api.getpostman.com/environments/{{environment_uid}}

//For example, say if you have your API Key parametised as an env variable and it's now changed.
// Just find the 'key' called "apiKey" or whatever you have named the env variable inside the 'values' array.
// Not just change the 'value' linked with that 'apiKey' 'key'

//Submit the request and boom. All the subscribers to that environment should have the new API Key 

```

😃

Obviously try this out with an example shared environment before you start changing things that are actually shared with your team.

Moderators - If this is confirmed as working I’ll be more than happy to post this in the Community Showcase section of the forum.

---

<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:10am UTC](https://community.postman.com/t/automatically-update-shared-environment/188/5 "2018-03-19T11:10:23Z")

</div>

Hi @Julien_Gagneux

We’ve made some changes to shared environments with `Postman 6.0`. Any environment added to a team workspace is available to everyone in the workspace.

Updates made to shared environments are shared and are synced with everyone.

Hope this helps.

Thanks.
