Skip to navigation

Rotate API key for service user

Rotate an API key for a service user.

Creates a new key. By default revokes the old key; set revoke_current=false for graceful rollover where both keys remain active temporarily. Returns 404 if the key is not found, 400 if the key is not active.

Authentication

AuthorizationBearer

Personal API Key (apk_user_) or Service API Key (apk_)

Path parameters

service_user_idstringRequired

Service user ID (prefix: service-user-)

api_key_idstringRequired

Request

This endpoint expects an object.
new_key_expires_atinteger or nullOptional
Optional expiration for the new key as a UNIX timestamp in seconds. Null for no expiration.
revoke_currentbooleanOptionalDefaults to true
Whether to revoke the current key. Set to False for graceful rollover.

Response

Successful Response
api_key_idstring
api_key_namestring
tokenstring

The raw API token. This is only shown once at creation/rotation time.

Errors

422
Unprocessable Entity Error