# Set Credentials programmatically

**URL:** <https://community.n8n.io/t/set-credentials-programmatically/106331>\
**Category:** Questions\
**Tags:** credentials\
**Created:** [April 25, 2025, 6:23pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331 "2025-04-25T18:23:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ezequiel\_Perez\_Rovir](https://avatars.discourse-cdn.com/v4/letter/e/41988e/32.png) [@Ezequiel\_Perez\_Rovir](https://community.n8n.io/u/Ezequiel_Perez_Rovir)\
**Post date:** [April 25, 2025, 6:23pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/1 "2025-04-25T18:23:07Z")

</div>

Hi,

I’m investigating the possibility of setting Query Auth credentials programmatically. In my business case, I have several customers accessing an HTTP endpoint that requires each customer’s specific API key to access only their own data.

I found this old post:

[Set Credentials programmatically [GOT CREATED]](http://community.n8n.io/t/set-credentials-programmatically-got-created/1748/19)

I’d like to know if anyone has already solved this kind of flow.

I’m on n8n cloud latest version

Many thanks!

---

<div class="post-metadata">

**Author:** ![ThinkBot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thinkbot/32/62172_2.png) [@ThinkBot](https://community.n8n.io/u/ThinkBot)\
**Post date:** [April 25, 2025, 6:37pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/2 "2025-04-25T18:37:30Z")

</div>

What is the node type?

Also how are you selling this to customers? In many cases reselling access to internal automations would fall under needing an embedded or whitelabel license.

---

<div class="post-metadata">

**Author:** ![Ezequiel\_Perez\_Rovir](https://avatars.discourse-cdn.com/v4/letter/e/41988e/32.png) [@Ezequiel\_Perez\_Rovir](https://community.n8n.io/u/Ezequiel_Perez_Rovir)\
**Post date:** [April 25, 2025, 6:46pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/3 "2025-04-25T18:46:16Z")

</div>

The node is a custom Https node. I’m not reselling access. The use case is a Real Estate AI assitant providing user assitance by answering questions about properties of Real Estate agencies (my customers). To get info about properties I need to access to the HTPPS node with each Real Estate agency’s keys, given that the service is a centralized one, where multiple agencies can access.

---

<div class="post-metadata">

**Author:** ![ThinkBot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thinkbot/32/62172_2.png) [@ThinkBot](https://community.n8n.io/u/ThinkBot)\
**Post date:** [April 25, 2025, 10:09pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/4 "2025-04-25T22:09:21Z")

</div>

In that case, how do you make the HTTP requests now? Just to help guide if this is doable.

You could easily dynamically enter if its something like a Bearer or Basic authorization header, and you can just store the keys on a google sheet or database with the names of the agency.

---

<div class="post-metadata">

**Author:** ![Ezequiel\_Perez\_Rovir](https://avatars.discourse-cdn.com/v4/letter/e/41988e/32.png) [@Ezequiel\_Perez\_Rovir](https://community.n8n.io/u/Ezequiel_Perez_Rovir)\
**Post date:** [April 28, 2025, 2:26pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/5 "2025-04-28T14:26:12Z")

</div>

Hi @ThinkBot, thanks for your response.

I’m making the HTTP request using a **Generic Credential Type** with **Query Auth** , setting up the API key credentials for each agency.

While searching the community for a similar case, I found this thread: [Select credentials via expression](http://community.n8n.io/t/select-credentials-via-expression/5150), which addresses exactly the same issue.

In that thread, they mention this workflow: [Set credentials dynamically using expressions | n8n workflow template](https://n8n.io/workflows/2223-set-credentials-dynamically-using-expressions), which could be an option, although it carries the risk of exposing credentials publicly.

Thanks!

---

<div class="post-metadata">

**Author:** ![liam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/liam/32/34968_2.png) [@liam](https://community.n8n.io/u/liam)\
**Post date:** [April 28, 2025, 3:45pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/6 "2025-04-28T15:45:24Z")

</div>

Hi,

You are able to make credentials through the n8n node. Unfortunately you cannot dynamically use them.

I have solved this by using JWT auth, but that is rather advanced (essentially handling all of the auth manually)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [May 6, 2025, 3:05pm UTC](https://community.n8n.io/t/set-credentials-programmatically/106331/7 "2025-05-06T15:05:08Z")

</div>

Closed on May 6, 2025, 3:05pm UTC

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