# Accessing the credential vault from a workflow

**URL:** <https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980>\
**Category:** Automations\
**Tags:** latest-dynatrace, workflows\
**Created:** [March 23, 2023, 7:32pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980 "2023-03-23T19:32:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottD](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ScottD](https://community.dynatrace.com/u/ScottD)\
**Post date:** [March 23, 2023, 7:32pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/1 "2023-03-23T19:32:15Z")

</div>

When I pass an&nbsp;Authorization header in an “HTTP Request” workflow action using the credential vault format that can be used with HTTP monitors, I get HTTP 401 errors:

{  
“Accept”: “application/json; charset=utf-8”,  
“Content-Type”: “application/json; charset=utf-8”,  
“Authorization”: “Api-Token {CREDENTIALS\_VAULT-54B131CE41C87603|token}”  
}

If I hard-code the API token itself in the workflow’s&nbsp;Authorization header instead, it works fine:

{  
“Accept”: “application/json; charset=utf-8”,  
“Content-Type”: “application/json; charset=utf-8”,  
“Authorization”: “Api-Token dt0c01.GNLBY51QNGTC9TVHRNUH3U2Y.3IYAIBF5L2QTRMVG3A4B2LHULQLUMK32A4EJ12567VIEHK4PNVWLNJQXUAPGUBGI”  
}

The credential vault entity ID being used is valid, and the API token being referenced has the correct scope. I’m working with the&nbsp;/synthetic/executions/batch API in this case, but I expect the issue applies to other use cases as well.

Is there a way to use the credential vault in a workflow, the way you can with HTTP monitors? Or will this be possible in the future? I do not want to have to hard-code API tokens into workflows.

_The credential vault and token values shown above are not real, BTW._

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [March 24, 2023, 7:34am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/2 "2023-03-24T07:34:11Z")

</div>

Hi ScottD,

Unfortunately, there’s no way to access vault credentials (or any settings) in the `HTTP Request` action. However, there is a plan to add support for it soon.

---

<div class="post-metadata">

**Author:** ![ScottD](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ScottD](https://community.dynatrace.com/u/ScottD)\
**Post date:** [May 12, 2023, 4:45pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/3 "2023-05-12T16:45:48Z")

</div>

Is this possible yet? I have the same question as it pertains to Notebooks; I’m trying to set up a Dynatrace API call in a Notebook code section. It works, but only if I hard-code the token.

---

<div class="post-metadata">

**Author:** ![duke](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/duke/32/1172_2.png) [@duke](https://community.dynatrace.com/u/duke)\
**Post date:** [October 11, 2023, 2:36am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/4 "2023-10-11T02:36:46Z")

</div>

Hi Michal\_zawislak,  
How’s the current process working? We utilize API calls within our workflow scripts, and are interested in have a finer level access control and using Dynatrace credential vault for security concerns.

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [October 11, 2023, 6:36am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/5 "2023-10-11T06:36:04Z")

</div>

Hi&nbsp;[@duke](https://community.dynatrace.com/user/60221),

We’re working on the possibility of using the credential vault in the “HTTP Request” action as we speak.

I’m not sure, but if by “workflow scripts” you mean running “Run Javascript” actions, could you please try using the [@dynatrace-sdk/client-classic-environment-v2](https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#credentialvaultclient)&nbsp;SDK?

Please let me know if that answers your question.

---

<div class="post-metadata">

**Author:** ![duke](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/duke/32/1172_2.png) [@duke](https://community.dynatrace.com/u/duke)\
**Post date:** [October 11, 2023, 8:07am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/6 "2023-10-11T08:07:54Z")

</div>

Hi&nbsp;[@michal\_zawislak](https://community.dynatrace.com/user/57046), thanks that works. Appreciate for the prompt response. However found it’s working on Workflow but not the Notebooks, wondering what’s the diff between those two apps? And is there a way to perform it in Notebooks.

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [October 12, 2023, 6:33am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/7 "2023-10-12T06:33:09Z")

</div>

Hi&nbsp;[@duke](https://community.dynatrace.com/user/60221),&nbsp;I’m glad it works!

There are a few differences between those two apps, but at this point, it’s hard to tell which one plays a role here.&nbsp;Could you please share an error you’re getting when running your script in Notebooks? It would help to narrow down the root cause.

---

<div class="post-metadata">

**Author:** ![ScottD](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ScottD](https://community.dynatrace.com/u/ScottD)\
**Post date:** [September 21, 2026, 3:56pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/8 "2026-09-21T15:56:37Z")

</div>

I have another need for this functionality -- accessing the credential vault from a JSON payload in an HTTP Request task. Is there a way to do this yet, now that it’s about 3.5 years later? Maybe I’m looking in the wrong spot as usual, but I’m [not seeing it](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/default-workflow-actions/http-request-workflow-action).

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [September 21, 2026, 4:11pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/9 "2026-09-21T16:11:12Z")

</div>

Hi&nbsp;[@ScottD](https://community.dynatrace.com/user/35196),

“HTTP Request” action supports&nbsp;using credentials from the credential vault for Basic and Token authentication. This is also mentioned in the [documentation](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/default-workflow-actions/http-request-workflow-action) you linked in the " **Authentication"** bullet point.

 ![michal_zawislak_0-1790006881107.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/c8881b605c66cc451c64db9c85b1246b416e1149.png)

Is this what you’re looking for or maybe I overlooked something? Please let me know.

---

<div class="post-metadata">

**Author:** ![ScottD](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ScottD](https://community.dynatrace.com/u/ScottD)\
**Post date:** [September 22, 2026, 12:23pm UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/10 "2026-09-22T12:23:13Z")

</div>

Right, thanks, that’s clear, but I misspoke. What I’m after currently is a bit different from the original ask: I’m wanting to send what is stored as a token in the credential vault not as an auth header but as a custom JSON field, in the HTTP Request task’s POST payload. Is that possible, or do I need to use a JS task to accomplish that?

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [September 25, 2026, 8:06am UTC](https://community.dynatrace.com/t/accessing-the-credential-vault-from-a-workflow/38980/11 "2026-09-25T08:06:37Z")

</div>

Yes, please use the JS task for this, at least for now. I’ll check what we can do in this regard.
