v172

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-0826148911.7 MB
API keys

Update an API key

Updates mutable fields of an API key: display name, status (active / disabled / revoked), permission mode and access map, project scope, and constraints (budget / rate limit / expiry). Omitted fields keep their current values.

patch/v2/api-keys/{api_key_id}

Path parameters

api_key_idstring required

API key id to update.

Request body

namestring

New name. Omit to keep current.

status'API_KEY_STATUS_UNSPECIFIED' | 'API_KEY_STATUS_ACTIVE' | 'API_KEY_STATUS_DISABLED' | 'API_KEY_STATUS_REVOKED'
permission_mode'PERMISSION_MODE_UNSPECIFIED' | 'PERMISSION_MODE_ALL' | 'PERMISSION_MODE_RESTRICTED' | 'PERMISSION_MODE_READ_ONLY'
accessobject

Replacement access map. Required when changing to PERMISSION_MODE_RESTRICTED; ignored otherwise. Provide an empty map to clear. See ApiKey.access for the full catalog of valid keys (Domain.id) and AccessLevel string values, or fetch the live catalog via the capability catalog endpoint.

expires_atstring date-time

New expiration. Omit to keep current. Set clear_expires_at = true to remove an existing expiration (a zero Timestamp here would still mean "no change" because of optional semantics).

clear_expires_atboolean

Force-clear the expiration. Mutually exclusive with expires_at.

Response

API key updated successfully.

idstring required
namestring required
workspace_idstring required
tokenstring required

Raw on create/retrieve and masked in list responses.

activeboolean
is_legacyboolean
sourcestring
budgetobject
expirationstring date-time
projectsstring[]
created_by_idstring nullable
updated_by_idstring nullable
createdstring date-time
updatedstring date-time
consumptionnumber
token_consumptionnumber
requests_per_minute_consumptionnumber
ownerobject
project_scopeobject
permission_modestring
accessobject
token_prefixstring
statusstring
constraintsobject
mcp_accessobject
legacy_token_familystring
legacy_key_idstring
last_used_atstring date-time