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_id
Service user ID (prefix: service-user-)
api_key_id
Request
This endpoint expects an object.
new_key_expires_at
Optional expiration for the new key as a UNIX timestamp in seconds. Null for no expiration.
revoke_current
Whether to revoke the current key. Set to False for graceful rollover.
Response
Successful Response
api_key_id
api_key_name
token
The raw API token. This is only shown once at creation/rotation time.
Errors
422
Unprocessable Entity Error