Creating Credentials using API

Add Credentials using API but the type doesn’t fit any of predefined.

I want to create Credentials for my API Keys but this API key is used by shell command so instead of storing in conf.ini is there a way I can store it in n8n. Also, can I add/Modify/Remove using API

I am using the latest n8n fresh install.

  • n8n version:1.72.1
  • Database (default: SQLite):SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n
  • Operating system: Ubuntu 24
    Thanks in advance

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @MXA_Music , n8n API allows the following three operations:

  • Get the credentials schema
  • Create credentials
  • Delete credentials

I’m afraid there is no “modify” option, API reference | n8n Docs.

So Can I create Custom Schema to Store Generic API Keys

No, the schemas are predefined. You need to know the schema for the credential type you want to create to be able to compose your “create” request body correctly.

The credential type names could be obtained from n8n repo.

For example, you want to create (save) ClickUp API key. The credential type name for such a credential is called clickUpApi. Using the endpoint /api/v1/credentials/schema/clickUpApi you can learn that the credential has to have the structure as per schema

{
	"additionalProperties": false,
	"type": "object",
	"properties": {
		"accessToken": {
			"type": "string"
		}
	},
	"required": []
}

That is, the request to create ClickUp API credential requires just one string field called accessToken. To actually create the credential the POST request to /api/v1/credentials should have the body like below

{
    "name": "My ClickUp API",
    "type": "clickUpApi",
    "data": {
        "accessToken": "YOUR_API_KEY"
    }
}
1 Like

Much appreciated

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