Payezydevelopers
Sandbox

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

  • Permissionapi_keys:manage
  • Second factorRequired for browser sessions. An API key with the scope replaces it.

Parameters

ParameterWhat it does
orgIdpath, uuidrequiredThe 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, uuidrequiredAn API key id from the key list.

Request body

FieldWhat it does
overlap_hoursintegerNo description in the spec yet.

Default 24

Response 201

The replacement key

FieldWhat it does
idstring (uuid)requiredNo description in the spec yet.
public_idstringrequiredNo description in the spec yet.
modeenumrequiredNo description in the spec yet.

One of test live

namestringrequiredNo description in the spec yet.
scopesstring[]requiredNo description in the spec yet.
allowliststring[]requiredNo description in the spec yet.
expires_atstring (date-time)requiredNo 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)requiredNo 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.
secretstringrequiredShown once. Store it now.

Errors to handle

CodeWhat it means and what to do
invalid_overlap422overlap must be between 0 and 72 hours
api_key_inactive409this key is no longer active

Every error is a Problem document. Branch on code; quote request_id to support.