Refresh an API key
Changed onAtomically revoke an existing API key and issue a replacement with the same metadata (name, description, and key type).
The old key is invalidated and the new key is activated in a single transaction — there is no window where neither key is valid. The full new key value (key) is only returned once in the response. Store it securely.
When developer access is disabled for an account, refreshing a user key or service key returns 403.
Authorization:
- User keys: The creator or an account admin may refresh the key.
- Service keys: space admins (and higher) may refresh any service key in their space. Non-admins require the SERVICE_KEY_CREATE permission and must be the creator of the key.
Expiry behaviour: expires_at is required when the existing key has an expiry — omitting it would extend the key's lifetime to unbounded and is rejected with 422. For unbounded existing keys, expires_at may be omitted (the replacement is also unbounded) or supplied to add a specific expiry. The value must not be later than the existing key's expiry; to issue a key with a longer lifetime, use POST /v2/api-keys.
Account key lifetime limit: If your account limits the maximum API key lifetime, an expires_at beyond that maximum is rejected with 422. When the existing key has no expiry and expires_at is omitted, the refreshed key expires at the maximum lifetime from now. To bring a key that exceeds the limit into compliance, supply a compliant expires_at.
Grace period: Supply grace_period_seconds in the request body to keep the old key valid for that many seconds after the refresh. If not supplied, the old key is revoked immediately.
<Note>This endpoint is in beta, read more here.</Note>
Request
- Base URLhttps://api.arize.com
- URLhttps://api.arize.com/v2/api-keys/{api_key_id}/refresh
- AuthHTTP bearer
Path parameters
A universally unique identifier (base64-encoded opaque string).
The unique API key identifier (base64)
Request body
Example request
{
"expires_at": "2027-01-01T00:00:00Z",
"grace_period_seconds": 300
}Response
Refreshed API key. The raw replacement key is only returned once.
Changes
- breaking
the response's body type changed from no type to
objectfor status - info
removed
subschema #2from the response bodyallOflist for the response status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking
- warning
added the new
ACTIVEenum value to the////response property for the response status - warning
added the new
REVOKEDenum value to the////response property for the response status - warning
added the new
SERVICEenum value to the////response property for the response status - warning
added the new
USERenum value to the////response property for the response status - info
api operation id
api_keys_refreshremoved and replaced withrefresh_api_key - info
added the new optional request property
- info
added the non-success response with the status
- info
added the optional property
////to the response with the status - info
removed the
activeenum value from the////response property for the response status - info
removed the
deletedenum value from the////response property for the response status - info
removed the
serviceenum value from the////response property for the response status - info
removed the
userenum value from the////response property for the response status
- warning