API reference / Identity and access
Roll an API key
POST/v1/orgs/{orgId}/api-keys/{keyId}/roll
Mint a replacement secret. The current secret keeps working for the overlap, at most 72 hours (api_keys:manage, AAL2).
When to use it
Rotate a secret with an overlap so running systems can switch without downtime.
Before you call it
- Permission
api_keys:manage - Second factorRequired for browser sessions. An API key with the scope replaces it.
Parameters
| Parameter | What it does |
|---|---|
orgIdpath, uuidrequired | The organization the call acts on. For platform calls, your platform's id; for customer calls, the customer's organization id. Get them from getMe or the customer list. |
keyIdpath, uuidrequired | An API key id from the key list. |
Request body
| Field | What it does |
|---|---|
overlap_hoursinteger | No description in the spec yet. Default |
Response 201
The replacement key
| Field | What it does |
|---|---|
idstring (uuid)required | No description in the spec yet. |
public_idstringrequired | No description in the spec yet. |
modeenumrequired | No description in the spec yet. One of |
namestringrequired | No description in the spec yet. |
scopesstring[]required | No description in the spec yet. |
allowliststring[]required | No description in the spec yet. |
expires_atstring (date-time)required | No description in the spec yet. |
overlap_untilstring (date-time) | No description in the spec yet. |
revoked_atstring (date-time) | No description in the spec yet. |
last_used_atstring (date-time) | No description in the spec yet. |
created_atstring (date-time)required | No description in the spec yet. |
minted_by_platform_idstring (uuid) | Set when a platform minted this key for the customer. Absent for keys created on the Developer page. |
secretstringrequired | Shown once. Store it now. |
Errors to handle
| Code | What it means and what to do |
|---|---|
invalid_overlap422 | overlap must be between 0 and 72 hours |
api_key_inactive409 | this key is no longer active |
Every error is a Problem document. Branch on code; quote request_id to support.