Token-Based Authentication#
You exchange an API key and secret for an access token, then send that token with every request.Prerequisites#
Before authenticating, create an API key in the Convirza portal under Manage → API Access:API Key (identifies your application)
API Secret (authenticates your application)
Important: Keep api_secret confidential. Never commit it to version control or expose it in client-side code.How It Works#
1.
Send your API key to POST /oauth/token/client-credentials
Include: grant_type (client_credentials), api_key, api_secret
Receive an access_token and a refresh_token (in the response data)
Store both tokens securely on your server
2.
Include the access token in every request: Authorization: Bearer <access_token>
A missing, expired or revoked token gets a 401 error
3.
Access Token: Valid for 7 days
Refresh Token: Valid for 30 days (less if your API key expires sooner). Each one works once: POST /oauth/refresh-token returns a new pair and the old pair stops working
Format: Use tokens exactly as you receive them. They can't be decoded
Revocation: Immediate via POST /oauth/revoke-token
Authorization: Bearer <access_token>
Token Lifecycle#
Client Credentials → Access Token (7d) + Refresh Token (30d)
↓
Use Access Token for API calls
↓
Access Token Expires → Use Refresh Token → New Token Pair
↓
Refresh Token Expires or Rejected → Request New Pair via Client Credentials
Modified at 2026-11-26 12:44:39