# Environment specific vault values

**URL:** <https://community.postman.com/t/environment-specific-vault-values/62156>\
**Category:** Help Hub\
**Tags:** environments\
**Created:** [June 13, 2024, 12:02am UTC](https://community.postman.com/t/environment-specific-vault-values/62156 "2024-06-13T00:02:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssuch-westjet](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@ssuch-westjet](https://community.postman.com/u/ssuch-westjet)\
**Post date:** [June 13, 2024, 12:02am UTC](https://community.postman.com/t/environment-specific-vault-values/62156/1 "2024-06-13T00:02:18Z")

</div>

I have an environment specific secret value, for example an API key. I want to store this value in Postman Vault, but be able switch between keys when changing environments and reference only 1 variable. Is this possible?

environment: env1  
my\_api\_key = {{vault:my\_api\_key\_env1}}

environment: env2  
my\_api\_key = {{vault:my\_api\_key\_env2}}

Post request  
Auth-header={{my\_api\_key}} (scope env)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [June 13, 2024, 11:38am UTC](https://community.postman.com/t/environment-specific-vault-values/62156/2 "2024-06-13T11:38:29Z")

</div>

Have you tried it? Sounds like it should work.

---

<div class="post-metadata">

**Author:** ![ssuch-westjet](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@ssuch-westjet](https://community.postman.com/u/ssuch-westjet)\
**Post date:** [June 20, 2024, 10:58pm UTC](https://community.postman.com/t/environment-specific-vault-values/62156/3 "2024-06-20T22:58:48Z")

</div>

The variable from inside the environment value doesn’t get resolved and comes as a string `{{vault:my_api_key_env1}}`

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [June 21, 2024, 8:46am UTC](https://community.postman.com/t/environment-specific-vault-values/62156/4 "2024-06-21T08:46:55Z")

</div>

You can’t console log it in scripts as it will show as a string.

You can’t retrieve the values in scripts either.

You can only use the vault values in certain places like the request body, authentication tabs, URL, etc.

This topic relates.

[Access Postman Vault from Pre-Request Script - 🙋 Help - Postman Community](https://community.postman.com/t/access-postman-vault-from-pre-request-script/60869)

---

<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:** [July 21, 2024, 8:46am UTC](https://community.postman.com/t/environment-specific-vault-values/62156/5 "2024-07-21T08:46:58Z")

</div>

Closed on July 21, 2024, 8:46am UTC

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