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
boolean
default:"false"
Include permission scopes in the response
boolean
default:"false"
Include credential data (encrypted fields will be redacted)
Only return credentials shared with you (excludes owned credentials)
boolean
default:"true"
Include globally shared credentials
object
Filter credentials by various criteria
Example Request
Response
array
Array of credential objects
string
Unique credential identifier
string
Credential name
string
Credential type (e.g., “googleSheetsOAuth2Api”, “httpBasicAuth”)
boolean
Whether the credential is globally shared across all projects
boolean
Whether the credential is managed by an external system
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
string[]
Permission scopes (only if
includeScopes=true)Example Response
Get Credential
Retrieve details of a specific credential.Path Parameters
string
required
The credential ID
Query Parameters
boolean
default:"false"
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
string
required
Credential name (1-128 characters)
string
required
Credential type identifier (e.g., “httpBasicAuth”, “googleSheetsOAuth2Api”)
object
required
Credential data with authentication fields specific to the credential type
string
Project ID to create credential in (defaults to personal project)
boolean
default:"false"
Whether to share the credential globally across all projects (requires permission)
boolean
default:"false"
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
string
required
The credential ID to update
Request Body
All fields are optional. Only include fields you want to update.string
Updated credential name
object
Updated credential data. You must provide all fields, not just changed ones.
boolean
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
string
required
The credential ID to delete
Example Request
Response
Test Credential
Test if a credential configuration is valid.Request Body
object
required
Example Request
Response
- Success
- Failure
Share Credential
Share a credential with other projects.Path Parameters
string
required
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
string
required
The credential ID to transfer
Request Body
string
required
The target project ID
Example Request
Generate Unique Name
Generate a unique credential name (useful when creating credentials).Query Parameters
string
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