# Not able to retrieve the postman vault key

**URL:** <https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270>\
**Category:** Learning Lab\
**Tags:** variables\
**Created:** [October 3, 2025, 2:43pm UTC](https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270 "2025-10-03T14:43:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdayalan](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kdayalan](https://community.postman.com/u/kdayalan)\
**Post date:** [October 3, 2025, 2:43pm UTC](https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270/1 "2025-10-03T14:43:18Z")

</div>

Hi

I am trying to setup api and secret keys set up in postman vault and use it in the pre request script

using pm.variables.get(“Api\_key”) but it is returning empty

what is the reason

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 3, 2025, 4:41pm UTC](https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270/2 "2025-10-03T16:41:44Z")

</div>

Hey @kdayalan 👋🏻

Accessing vault secrets via a script is a slightly different method than normal scoped variables.

You need to first explicitly toggle the option to give access the vault, via the vault settings, then you use the `pm.vault.get()` function in the script sandbox.

More details can be found here:

> **[Process data and script workflows using Postman JavaScript objects | Postman...](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#use-vault-secrets-in-scripts)**
>
> Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.

---

<div class="post-metadata">

**Author:** ![kdayalan](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kdayalan](https://community.postman.com/u/kdayalan)\
**Post date:** [October 6, 2025, 6:38pm UTC](https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270/3 "2025-10-06T18:38:44Z")

</div>

Thank you Danny ,also can we fetch the Keys from Azure Key Vault to Postman Vault and Vice

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 6, 2025, 9:22pm UTC](https://community.postman.com/t/not-able-to-retrieve-the-postman-vault-key/85270/4 "2025-10-06T21:22:19Z")

</div>

You can integrate an external vault, the keys from that service can be used directly in your HTTP requests.

More information can be found on the Docs site:

> **[Integrate Postman Vault with external vaults | Postman Docs](https://learning.postman.com/docs/sending-requests/postman-vault/postman-vault-integrations/)**
>
> Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.

It wouldn’t allow you to pull them down into your Vault or add secrets to an external vault.
