Overview
API tokens are:- Base-scoped: Each token is associated with a specific base
- Non-expiring: Unlike JWT tokens, API tokens don’t expire automatically
- User-linked: Tokens inherit the permissions of the user who created them
- Revocable: Can be deleted at any time
Creating API Tokens
Via API
Create a new API token programmatically using the API.Unique identifier of the base (e.g.,
p_124hhlkbeasewh)Description of the API token (max 255 characters). Used to identify the token’s purpose.
Unique identifier for the token
ID of the user who created the token
Token description
The actual API token string (40 characters). Save this securely - it cannot be retrieved again.
Using API Tokens
Once created, use your API token in thexc-token header for all API requests:
Listing API Tokens
Retrieve all API tokens for a specific base.Unique identifier of the base
Array of API token objects
Pagination information
Deleting API Tokens
Revoke an API token when it’s no longer needed.Unique identifier of the base
ID of the API token to delete
The response returns
1 to indicate successful deletion.API Token Scoping
SSO Integration
API tokens created by users logged in via SSO (Single Sign-On) are associated with the SSO client. This ensures:- Tokens are properly linked to the SSO authentication method
- SSO users can see both SSO and non-SSO tokens they created
- Non-SSO users only see non-SSO tokens
Permissions
API tokens inherit the permissions of the user who created them:- Base-level access: Tokens can only access the base they were created in
- Role-based permissions: Token operations are limited by the creator’s role (viewer, editor, owner, etc.)
- Data access: Tokens respect all view filters, field visibility, and row-level permissions
Organization API Tokens
Organization-level API tokens provide access across all bases in an organization. These are only available to super admins.List Organization Tokens
Create Organization Token
Delete Organization Token
Access to organization token endpoints is blocked when using API token authentication. You must use JWT authentication.
Best Practices
Descriptive Names
Use clear descriptions like “Production CI/CD Pipeline” or “Slack Integration” to easily identify token purposes
Least Privilege
Create tokens with the minimum required permissions by using accounts with appropriate roles
Regular Rotation
Periodically rotate tokens, especially for critical integrations
Secure Storage
Store tokens in environment variables or secret management systems, never in source code
Common Use Cases
CI/CD Integration
Use API tokens to automate database updates in your deployment pipeline:Webhook Integration
Authenticate webhook requests to NocoDB:Scheduled Jobs
Automate data synchronization with cron jobs:Troubleshooting
Invalid Token Error
If you receive an authentication error:- Verify the token is being sent in the
xc-tokenheader - Ensure the token hasn’t been deleted
- Check that you’re accessing the correct base
- Confirm the token creator still has access to the base
Permission Denied
If operations fail with permission errors:- Check the role of the user who created the token
- Verify base-level permissions for that user
- Ensure the operation is allowed for that role
Token Not Found in List
If tokens don’t appear in the list:- SSO users see all tokens; non-SSO users only see non-SSO tokens
- Tokens are base-scoped - check the correct base
- Ensure you have permission to view tokens in the base