N8n API Add functions for credentials


I would like to suggest adding some functions in the API in order to be able to manipulate more easily the crendetials
1°) updateCredentials - (By Name / By Id)

This function would allow to update the existing credentials in case of key or password rotation in the applications.

Use case:
RabbitMQ : credentials are managed by Hashicorp Vault, a key rotation is active, credentials expire after a certain time
In n8n, with the id or the name of the credentials we could update the login information directly.

Currently, there is no choice but to create a new credential, and delete the previous one.

2°) getAllCredentials

This function would allow to list all credentials, without returning confidential information. The purpose of this function would be to search for a credential in the database and to retrieve its id/name in order to update it.

Use case:
A credential needs to be updated. The API would allow to list the APIs. With this list, we could find the desired credential, retrieve its Id and use the previous API (updateCredential) to update it.

Currently, there is no way to get the ID of a credential
In fact, I also wonder about the usefulness of the delete credentials by Id function, if we can’t have an id in a programmed way. We absolutely need to know the Id in a “manual” way

Why these function : Nowadays, computer security is becoming more and more important. Many systems are starting to implement secret rotation mechanisms through applications such as Hashicorp Vault.

The implementation of these features would allow more flexibility for n8n nodes.


I can see the public API was only merged in June this year - nicely done! I would like to add a use case for getAllCredentials AKA a GET /credentials endpoint.

I’m currently using n8n to integrate firefly-iii and grist-core. I did it using an n8n workflow, but I also made a grist widget that gives the user control over the integration (via the workflow itself and the n8n API). One of the widget’s functions will be to install the n8n workflow inside n8n, then invoke the workflow to configure firefly-iii webhooks via its API. This needs a firefly-iii API key and a Grist API key to work, and ideally I’d like these to be stored and configured in n8n, not the user’s Grist document or widget settings.

To install the workflow in a user-friendly way, the user needs to be able to select which credential to use for grist and firefly-iii via the widget. It would be nice to populate a dropdown using a new endpoint GET /credentials .

That would be very useful! Patch should be available through api.

Also a little more documentation would help. I used my chrome devtools to inspect a manually created credential to be able to identify what should i put on the “type” required field do create a new credential.

Merry Christmas. Here is a PR for a GET /credentials endpoint