Pulling custom credential values into HTTP request's headers and body

Cannot pull the custom information saved in the credentials object into an HTTP header and body.

An external API i’m using requires to send the username in the request body. I thought the best way would be to keep it in the credentials, but I cannot find a way to pull it.

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @nimrod,

It’s not possible to reference values directly from stored credentials in n8n.

Sorry we can not see the actual credential you are using because share workflow code will not include this sensitive information.

But we might need more information first.


How you set the credential?
there are many way. Like query auth, header auth

Once you set them correctly.

You can just select the credential in the Http request node.

Here is an example for header auth.

1 Like

I believe this answer to be completely irrelevant to my case. its demonstrating how to set the credentials, which is pretty straight forward. I was asking about how to access the credential object from the http request custom header, and body

thanks Sudhanshu, I’ll have to figure out another way to deal with it then.

1 Like

Okay after think again about your question.

The credential is designed for bearer token.

Not recommend to set username as credential.


Why we can not access the value in credential?

Because we don’t want anyone we can directly see what’s the value inside.

So if we can pull the value from credential and see it.

Then we should not use credential at all. The meaning of protectation is gone here.

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