GET /keys/apiKey
Rotate your subscription key. Returns a new primary key and keeps the previous one valid as a secondary for 24 hours.
⚠️
Calling this endpoint immediately rotates your key. Make sure your deployment is ready to pick up the new key before calling.
Request
GET https://api.adzen.ai/keys/apiKeyExample
curl https://api.adzen.ai/keys/apiKey \
-H 'X-API-Key: YOUR_CURRENT_KEY'Response
200 OK
{
"apiKey": "prod-abcdef123456789",
"secondaryKey": "prod-previous-key-value",
"secondaryKeyExpiresAt": "2026-04-18T22:00:00Z"
}Response fields
| Field | Type | Description |
|---|---|---|
apiKey | string | The new primary key. Use this for all future requests. |
secondaryKey | string | The previous primary key. Still valid for 24 hours. |
secondaryKeyExpiresAt | string | ISO-8601 timestamp when the secondary key stops working. |
Typical workflow
- Call
GET /keys/apiKey - Store the new
apiKeyin your secrets manager - Deploy the new key to your application
- Old requests using
secondaryKeycontinue to succeed untilsecondaryKeyExpiresAt - After the expiry, only the new
apiKeyworks
Error responses
| Status | Meaning |
|---|---|
401 | Current key invalid |
502 | Key rotation infrastructure unavailable — try again later |