> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/credential.md).

# Credential

Operations about credentials

## List credentials

> Retrieve all credentials from your instance. Only available for the instance owner and admin. Credential data (secrets) is not included.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"limit":{"name":"limit","in":"query","description":"The maximum number of items to return.","required":false,"schema":{"type":"number","default":100,"maximum":250}},"cursor":{"name":"cursor","in":"query","description":"Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first \"page\" of the collection. See pagination for more detail.","required":false,"style":"form","schema":{"type":"string"}}},"schemas":{"credentialList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/credentialListItem"}},"nextCursor":{"type":"string","description":"Paginate through credentials by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.","nullable":true}}},"credentialListItem":{"allOf":[{"$ref":"#/components/schemas/create-credential-response"},{"type":"object","required":["shared"],"properties":{"shared":{"type":"array","description":"Shared entries (project id, name, role, createdAt, updatedAt) from the credential's shared relation","items":{"$ref":"#/components/schemas/credentialSharedItem"}}}}]},"create-credential-response":{"required":["id","name","type","isManaged","isGlobal","isResolvable","resolvableAllowFallback","createdAt","updatedAt"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"isManaged":{"type":"boolean","readOnly":true,"description":"Whether the credential is managed by n8n (managed credentials cannot be edited via the API)."},"isGlobal":{"type":"boolean","readOnly":true,"description":"Whether the credential is available for use by all users."},"isResolvable":{"type":"boolean","readOnly":true,"description":"Whether the credential can be dynamically resolved by a resolver."},"resolvableAllowFallback":{"type":"boolean","readOnly":true,"description":"Whether the credential resolver may fall back to static credentials if dynamic resolution fails."},"resolverId":{"type":"string","nullable":true,"readOnly":true,"description":"ID of the dynamic credential resolver associated with this credential, if any."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"credentialSharedItem":{"type":"object","required":["id","name","role","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Project ID"},"name":{"type":"string","description":"Project name"},"role":{"type":"string","description":"Role of the credential in this project (e.g. credential:owner)"},"createdAt":{"type":"string","format":"date-time","description":"When the credential was shared with this project"},"updatedAt":{"type":"string","format":"date-time","description":"When the sharing was last updated"}}}},"responses":{"unauthorized":{"description":"Unauthorized"}}},"paths":{"/credentials":{"get":{"operationId":"getCredentials","tags":["Credential"],"summary":"List credentials","description":"Retrieve all credentials from your instance. Only available for the instance owner and admin. Credential data (secrets) is not included.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credentialList"}}}},"401":{"$ref":"#/components/responses/unauthorized"}}}}}}
```

## Create a credential

> Creates a credential that can be used by nodes of the specified type.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"credentialCreate":{"required":["name","type","data"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"object","writeOnly":true},"isResolvable":{"type":"boolean","description":"Whether this credential has resolvable fields"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"projectId":{"type":"string","description":"Project to create the credential in. Defaults to the user's personal project."}}},"create-credential-response":{"required":["id","name","type","isManaged","isGlobal","isResolvable","resolvableAllowFallback","createdAt","updatedAt"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"isManaged":{"type":"boolean","readOnly":true,"description":"Whether the credential is managed by n8n (managed credentials cannot be edited via the API)."},"isGlobal":{"type":"boolean","readOnly":true,"description":"Whether the credential is available for use by all users."},"isResolvable":{"type":"boolean","readOnly":true,"description":"Whether the credential can be dynamically resolved by a resolver."},"resolvableAllowFallback":{"type":"boolean","readOnly":true,"description":"Whether the credential resolver may fall back to static credentials if dynamic resolution fails."},"resolverId":{"type":"string","nullable":true,"readOnly":true,"description":"ID of the dynamic credential resolver associated with this credential, if any."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials":{"post":{"operationId":"createCredential","tags":["Credential"],"summary":"Create a credential","description":"Creates a credential that can be used by nodes of the specified type.","requestBody":{"description":"Credential to be created.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/credentialCreate"}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/create-credential-response"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"},"415":{"description":"Unsupported media type."}}}}}}
```

## Get credential by ID

> Retrieves a credential by ID. Credential data (secrets) is not included.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"create-credential-response":{"required":["id","name","type","isManaged","isGlobal","isResolvable","resolvableAllowFallback","createdAt","updatedAt"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"isManaged":{"type":"boolean","readOnly":true,"description":"Whether the credential is managed by n8n (managed credentials cannot be edited via the API)."},"isGlobal":{"type":"boolean","readOnly":true,"description":"Whether the credential is available for use by all users."},"isResolvable":{"type":"boolean","readOnly":true,"description":"Whether the credential can be dynamically resolved by a resolver."},"resolvableAllowFallback":{"type":"boolean","readOnly":true,"description":"Whether the credential resolver may fall back to static credentials if dynamic resolution fails."},"resolverId":{"type":"string","nullable":true,"readOnly":true,"description":"ID of the dynamic credential resolver associated with this credential, if any."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/{id}":{"get":{"tags":["Credential"],"summary":"Get credential by ID","description":"Retrieves a credential by ID. Credential data (secrets) is not included.","operationId":"getCredential","parameters":[{"name":"id","in":"path","description":"The credential ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/create-credential-response"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Delete credential by ID

> Deletes a credential from your instance. You must be the owner of the credentials

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"credential":{"required":["name","type","data"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"object","writeOnly":true},"isResolvable":{"type":"boolean","description":"Whether this credential has resolvable fields"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/{id}":{"delete":{"tags":["Credential"],"summary":"Delete credential by ID","description":"Deletes a credential from your instance. You must be the owner of the credentials","operationId":"deleteCredential","parameters":[{"name":"id","in":"path","description":"The credential ID that needs to be deleted","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credential"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update credential by ID

> Updates an existing credential. You must be the owner of the credential.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"update-credential-request":{"type":"object","properties":{"name":{"type":"string","description":"The name of the credential"},"type":{"type":"string","description":"The credential type. If changing type, data must also be provided."},"data":{"type":"object","writeOnly":true,"description":"The credential data. Required when changing credential type."},"isGlobal":{"type":"boolean","description":"Whether this credential is available globally"},"isResolvable":{"type":"boolean","description":"Whether this credential has resolvable fields"},"isPartialData":{"type":"boolean","default":false,"description":"If true, unredacts and merges existing credential data with the provided data. If false, replaces the entire data object."}}},"create-credential-response":{"required":["id","name","type","isManaged","isGlobal","isResolvable","resolvableAllowFallback","createdAt","updatedAt"],"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string"},"isManaged":{"type":"boolean","readOnly":true,"description":"Whether the credential is managed by n8n (managed credentials cannot be edited via the API)."},"isGlobal":{"type":"boolean","readOnly":true,"description":"Whether the credential is available for use by all users."},"isResolvable":{"type":"boolean","readOnly":true,"description":"Whether the credential can be dynamically resolved by a resolver."},"resolvableAllowFallback":{"type":"boolean","readOnly":true,"description":"Whether the credential resolver may fall back to static credentials if dynamic resolution fails."},"resolverId":{"type":"string","nullable":true,"readOnly":true,"description":"ID of the dynamic credential resolver associated with this credential, if any."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/{id}":{"patch":{"tags":["Credential"],"summary":"Update credential by ID","description":"Updates an existing credential. You must be the owner of the credential.","operationId":"updateCredential","parameters":[{"name":"id","in":"path","description":"The credential ID that needs to be updated","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Credential data to update. All fields are optional.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/update-credential-request"}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/create-credential-response"}}}},"400":{"description":"Bad request - invalid credential type or data."},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Test credential by ID

> Tests a credential by ID using the stored credential data.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"credentialTestResponse":{"type":"object","required":["status","message"],"properties":{"status":{"type":"string","enum":["OK","Error"]},"message":{"type":"string"}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/{id}/test":{"post":{"tags":["Credential"],"summary":"Test credential by ID","description":"Tests a credential by ID using the stored credential data.","operationId":"testCredential","parameters":[{"name":"id","in":"path","description":"The credential ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credentialTestResponse"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## GET /credentials/schema/{credentialTypeName}

> Show credential data schema

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/schema/{credentialTypeName}":{"get":{"tags":["Credential"],"summary":"Show credential data schema","parameters":[{"name":"credentialTypeName","in":"path","description":"The credential type name that you want to get the schema for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Transfer a credential to another project.

> Transfer a credential to another project.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Credential","description":"Operations about credentials"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"credentialId":{"name":"id","in":"path","description":"The ID of the credential.","required":true,"schema":{"type":"string"}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/credentials/{id}/transfer":{"put":{"tags":["Credential"],"summary":"Transfer a credential to another project.","description":"Transfer a credential to another project.","parameters":[{"$ref":"#/components/parameters/credentialId"}],"requestBody":{"description":"Destination project for the credential transfer.","content":{"application/json":{"schema":{"type":"object","properties":{"destinationProjectId":{"type":"string","description":"The ID of the project to transfer the credential to."}},"required":["destinationProjectId"]}}},"required":true},"responses":{"200":{"description":"Operation successful."},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```
