v1

latestOpenAPI 3.1.02026-07-26269227514.8 KB
service_user_api_keys

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.

post/v3beta1/enterprise/service-users/{service_user_id}/api-keys/{api_key_id}/rotate

Path parameters

service_user_idstring required
Example:service-user-abc123def456

Service user ID (prefix: service-user-)

api_key_idstring required

Request body

new_key_expires_atinteger nullable

Optional expiration for the new key as a UNIX timestamp in seconds. Null for no expiration.

revoke_currentboolean

Whether to revoke the current key. Set to False for graceful rollover.

Response

Successful Response

api_key_idstring required
api_key_namestring required
tokenstring required

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