Authentication
Authenticate with the Zuora API using OAuth 2.0 client credentials
Zuora uses OAuth 2.0 client credentials for API authentication. You exchange a client ID and secret for a time-limited Bearer token, then include that token in every API request.
Legacy API keys (apiAccessKeyId / apiSecretAccessKey) are deprecated. Migrate to OAuth 2.0 for all new integrations.
Create an OAuth Client
Get a Bearer Token
Call the /oauth/token endpoint with your credentials:
cURL
Python
TypeScript
Java
Token Response
Use the Token
Include the token in the Authorization header of every API request:
Token Management Best Practices
Tokens expire after approximately 1 hour. Implement token caching and automatic refresh in your integration.
Recommended pattern
Key recommendations
- Cache tokens — Reuse a token until it expires instead of requesting a new one per API call.
- Refresh proactively — Refresh the token 60 seconds before expiry to avoid failed requests.
- Handle 401 errors — If you receive a
401 Unauthorized, refresh the token and retry. - Avoid rate limits — The
/oauth/tokenendpoint has its own rate limit. Requesting too many tokens triggers a429. - Scope awareness — The token scope determines which entities and operations are accessible.
Multi-Entity Authentication
If your Zuora tenant uses Multi-entity, include the Zuora-Entity-Ids header to target a specific entity:
The entity ID must be a valid UUID. You can find entity IDs in Settings > Administration > Manage Entities.