API Authentication
Learn how to authenticate your API requests.
Authentication Methods
API Keys
The primary method for API authentication:
Generate keys in Settings
Include in request headers
Keys are tied to your account
Full access based on your permissions
JWT Tokens
For web applications and OAuth flows:
Obtained through Auth0 login
Short-lived access tokens
Include in Authorization header
Using API Keys
Getting an API Key
Go to Settings > API Keys
Click Create API Key
Name your key (e.g., "Integration Key")
Copy the key immediately
Store it securely
Important: The key is only shown once. If you lose it, create a new one.
Including the Key in Requests
Add the key to the Authorization header:
Example Request
JWT Token Authentication
Obtaining a Token
Redirect user to Auth0 login
User authenticates
Receive access token
Use token in requests
Using the Token
Include the JWT in requests:
Token Expiration
Check
expclaim for expirationRefresh tokens before expiry
Re-authenticate if expired
Security Best Practices
Protect Your Keys
Never share API keys
Don't commit keys to code repositories
Use environment variables
Rotate keys periodically
Use HTTPS
Always use HTTPS for API requests:
Encrypts data in transit
Protects your credentials
Required for all endpoints
Least Privilege
Create keys with minimum needed access
Use separate keys for different integrations
Revoke unused keys
Monitor Usage
Review API key activity
Check for unusual patterns
Investigate unexpected usage
Permissions
API access respects your account permissions:
You can only access what you can access in the UI
Tenant isolation is enforced
Admin endpoints require admin role
Error Responses
Revoking Keys
If a key is compromised:
Go to Settings > API Keys
Find the compromised key
Click Revoke
Create a new key
Update your integrations
Testing Authentication
Verify Your Key Works
Expected response:
Common Issues
Last updated
Was this helpful?