ReferenceApi keys
Rotate an API key
Mints a replacement inheriting the original's name and scopes, then soft-revokes the old one.
The new key is created before the old is revoked, so a rotating client has an overlap window rather than an outage.
Authorization
ApiKeyAuth x-api-key<token>
A platform key (ck_live_…). Mint one in the console under
Settings → API Keys.
In: header
Path Parameters
key_id*string
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/api-keys/string/rotate" \ -H "Content-Type: application/json" \ -d '{}'{ "key_id": "string", "api_key": "string"}Was this page helpful?Report an issue