Overview
The Credentials API allows you to programmatically manage credentials used by workflow nodes for authentication. Credentials store sensitive information like API keys, OAuth tokens, and database passwords securely.List Credentials
Retrieve a list of credentials accessible to your account.Query Parameters
Include permission scopes in the response
Include credential data (encrypted fields will be redacted)
Only return credentials shared with you (excludes owned credentials)
Include globally shared credentials
Filter credentials by various criteria
Example Request
Response
Array of credential objects
Unique credential identifier
Credential name
Credential type (e.g., “googleSheetsOAuth2Api”, “httpBasicAuth”)
Whether the credential is globally shared across all projects
Whether the credential is managed by an external system
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Permission scopes (only if
includeScopes=true)Example Response
Get Credential
Retrieve details of a specific credential.Path Parameters
The credential ID
Query Parameters
Include credential data (sensitive fields will be redacted)
Example Request
Response
Sensitive credential fields are automatically redacted with
***REDACTED*** even when includeData=true. This protects secrets while allowing you to verify credential configuration.Create Credential
Create a new credential.Request Body
Credential name (1-128 characters)
Credential type identifier (e.g., “httpBasicAuth”, “googleSheetsOAuth2Api”)
Credential data with authentication fields specific to the credential type
Project ID to create credential in (defaults to personal project)
Whether to share the credential globally across all projects (requires permission)
Whether the credential uses dynamic resolution (Enterprise feature)
Example Request
- HTTP Basic Auth
- API Key
- OAuth2
Response
Returns the created credential object:Update Credential
Update an existing credential.Path Parameters
The credential ID to update
Request Body
All fields are optional. Only include fields you want to update.Updated credential name
Updated credential data. You must provide all fields, not just changed ones.
Update global sharing status (requires permission)
Example Request
Response
When updating credential
data, you must provide the complete data object. Partial updates are not supported for the data field.Delete Credential
Permanently delete a credential.Path Parameters
The credential ID to delete
Example Request
Response
Test Credential
Test if a credential configuration is valid.Request Body
Example Request
Response
- Success
- Failure
Share Credential
Share a credential with other projects.Path Parameters
The credential ID to share
Request Body
Array of project IDs to share the credential with
Example Request
Response
Returns204 No Content on success.
Sharing credentials requires the
credential:share permission and an Enterprise license.Transfer Credential
Transfer a credential to a different project.Path Parameters
The credential ID to transfer
Request Body
The target project ID
Example Request
Generate Unique Name
Generate a unique credential name (useful when creating credentials).Query Parameters
Base name for the credential. If not provided, uses the default “My credentials”.
Example Request
Response
If credentials with the requested name exist, a number is appended (e.g., “API Key 2”, “API Key 3”).
Credential Types
Common credential types in n8n:HTTP Authentication
HTTP Authentication
httpBasicAuth- Basic authenticationhttpDigestAuth- Digest authenticationhttpHeaderAuth- Header-based authenticationhttpQueryAuth- Query parameter authenticationoAuth1Api- OAuth 1.0oAuth2Api- OAuth 2.0
Database Credentials
Database Credentials
postgres- PostgreSQLmysql- MySQL/MariaDBmongoDb- MongoDBredis- RedismicrosoftSql- Microsoft SQL Server
Cloud Services
Cloud Services
aws- Amazon Web ServicesgoogleApi- Google Cloud PlatformazureApi- Microsoft Azure
SaaS Applications
SaaS Applications
slackApi- SlackgithubApi- GitHubgoogleSheetsOAuth2Api- Google SheetssalesforceOAuth2Api- SalesforcenotionApi- Notion
Security Best Practices
Use Least Privilege
Use Least Privilege
Grant credentials only the minimum permissions required for workflows to function.
Rotate Credentials Regularly
Rotate Credentials Regularly
Update API keys and passwords periodically to reduce security risks.
Audit Credential Usage
Audit Credential Usage
Regularly review which workflows use each credential and remove unused credentials.
Enable Global Sharing Carefully
Enable Global Sharing Carefully
Only mark credentials as global if they truly need to be accessible across all projects.
Test Before Deploying
Test Before Deploying
Always test credentials in a development environment before using them in production workflows.
Monitor for Leaks
Monitor for Leaks
Ensure credentials are never logged or exposed in workflow outputs.
Common Patterns
Programmatic Credential Rotation
Error Responses
400 Bad Request
403 Forbidden
404 Not Found
Next Steps
Workflows API
Use credentials in workflows
Authentication
Learn about API authentication
Security
Credential security best practices
Node Credentials
Learn about node credential types