Rotate an API key
POST/api-key/:keyId/rotate
Creates a replacement key with the same scopes and either revokes the old key immediately (default) or keeps it usable until gracePeriodExpiresAt. The new plaintext key is returned ONLY in this response and can never be retrieved again.
Request
Responses
- 201
- 400
- 401
- 404
- 429
Key rotated. data.newKey.key contains the new plaintext key, shown only once.
Validation error
Unauthorized - Invalid or missing API key
Resource not found
Rate limit exceeded
Response Headers
Retry-After