Attach New Credential Through API On The GO, How to Send Different Users Credentials In a Workflow

Describe the problem/error/question

I have created a workflow where I want to register new credentials through API (credentials of any available application available on n8n). I visited the API documentation provided (API Doc), but as there is not much explanation about how to add different credentials, I couldn’t find any solution there.
In the API, I couldn’t understand how to set the type field of the credential, as there is no other API listing all available types. Also, in the data field, there is no detailed explanation about how to set this field based on different types.

I am specifically interested in adding Google’s tools credentials through API (Or similar apps that use OAUTH).

Also, if not through API, is there any way that I can use the functionality of adding credentials on my ReactJS App (As embedded UI or something where I let my user add their credentials directly to n8n)?

In the end, I want to send different credentials (added in the last step) for different nodes in the same workflow. Currently, we have to select a credential from the dropdown, but I want to set that credential dynamically (along with specifying the node for which I am setting the credential dynamically). I am ok to send these details in the body, but currently I couldn’t find any such way.

I also saw the same question and vote poll in the community, but couldn’t find any way to solve.

What is the error message (if any)?

No such error message

Please share your workflow

Share the output returned by the last node

No such requirement

Information on your n8n setup

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

hello @Kaustubh_Rai
You can create credential manually, then get the type via the CLI command n8n export:credentials --id=credential_id --decrypted, where credential_id is the id of the desired credential in the Details Tab.

Hey @barn4k
The issue is that I can not create credentials manually. I know that it is possible, but I don’t want to do that. I have a lot of users and I want to enable them to connect their apps in my workflow.
Now I can not go and manually create credentials for each user or new users.
Now I believe you understand my problem better.

You can create an account only for one user to get the proper credential type from it. Then delete it and use the same type in the API

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