Rotate an API key
POST
Rotate an active API key: mint a successor copying the old key's name, scopes, domain, and environment, and stamp the old key to stop authenticating in 24 hours (a zero-downtime grace window). Only a key with no revoked_at can be rotated; a revoked or already-mid-grace key returns 409. The new plaintext key is returned once. Dashboard only (owner or admin). API keys get 403 insufficient_scope. Takes no request body.
Loading code example
Loading code example
Authorizations
Authorizationstringheaderrequired
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
idstringrequired
The API key resource id (key_…).
Response
application/json
The key was rotated; the successor's plaintext is shown once.
