Manual
CLI
API
Log in Get started free

Rotate a project key

Replaces a project API key by a new one.

Replaces a project API key by a new one.

HTTP
POST /projects/{projectId}/api-keys/{keyId}/rotate

Access: Session token only. API keys get 403 with insufficient_scope.

Role: Project manager.

The new key has the same name, scopes, owner and lifetime as the old one. If the organisation limits the lifetime of API keys, the new key lives at most that long. The old key stops working at once. The new value is shown only in this response.

Response 201 #

JSON
{ "token": "ct_live_...", "keys": [] }

token is the new key. keys is the list as the list route gives it.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
403forbiddenYou are a member of the project, but not a manager.
404not_foundThere is no such key in this project, or an id is not a UUID.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.