Update API key
Visibility: public · internal ( OpenAPI Custom Extension: x-visibility )
Update mutable fields on an API key. Supports changing the display name, description, roles (scope-down only — cannot exceed the creating user’s privileges), and toggling the status between active and disabled.
Regular users can only update keys they created. Requests targeting keys owned by other users return 404 to prevent key ID enumeration. Tenant administrators can update any key within the tenant.
Expired keys cannot be re-enabled. To restore access, create a new key.
Authorizations
Bearer token authentication using OAuth2/OIDC tokens
Path Parameters
API key resource identifier.
Body
Updated display name.
1 - 255Updated description.
1024Updated privilege ceiling for the key. Each role must be a valid org-defined role slug currently held by the caller within the key's scope. Effective privileges are evaluated at token-mint time as the intersection of this list and the creating user's current roles within the key's scope boundary.
Pass an empty array to remove the ceiling entirely, allowing the key to mirror the creating user's full privileges within the key's scope boundary.
Toggle key status. Only active ↔ disabled transitions are permitted. Expired keys cannot be modified.
active, disabled Response
Updated API key metadata.
API key for programmatic access. Keys are scoped to a level in the resource hierarchy (organization, or project) and inherit a subset of the creating user's privileges, evaluated dynamically at token-mint time. The key secret is an opaque, prefixed token shown only at creation and rotation time.
Server-generated UUID. Immutable.
Resource identifier. Provided by the client at creation or server-generated if omitted. Must be 1-63 lowercase characters matching a-z [blocked]?. Immutable after creation.
1 - 63^[a-z]([-a-z0-9]*[a-z0-9])?$"apikey-j2k3l4"
Human-readable display name for the API key.
1 - 255"CI/CD Pipeline Key"
The level in the resource hierarchy this key is scoped to. Determines the resource boundary for all operations performed with this key:
- organization: key can access all projects the creating user has access to within the tenant.
- project: key is restricted to a single project.
Combined with scopeId, this defines the key's blast radius. Subject to org-level policy constraints (e.g., an org may prohibit organization-scoped keys).
organization, project "project"
Resource identifier corresponding to the scope level:
- organization scope: the organization ID (derived from the caller's tenant — must match the caller's org).
- project scope: a project ID the caller has access to.
"proj-abc123"
Current key status.
- active: Key can be used to mint tokens.
- disabled: Temporarily suspended. Can be re-enabled via PATCH.
- expired: Past expiresAt. Terminal; cannot be re-enabled.
active, disabled, expired "active"
User ID of the principal who created this key. The key's privilege ceiling is derived from this user.
"user-xyz789"
Timestamp when the key was created.
Server-defined URL for this resource.
"/v1/iam/api-keys/apikey-j2k3l4"
Optional description of the key's intended use.
1024Optional role bindings that act as a privilege ceiling for the key. Effective privileges are evaluated at token-mint time, not at key creation time:
- When roles are set: effective privilege is the intersection of this list and the creating user's current roles for the key's project. If the user gains or loses roles, the key's effective privilege adjusts automatically.
- When empty or omitted: the key mirrors the creating user's full current roles for the project, expanding and shrinking as the user's roles change.
Each role must be a valid org-defined role slug. At creation and update time, every listed role must be held by the caller; however, the key remains valid if the user later loses a listed role (it simply has no effect until the user regains it).
Effective privileges are always bounded by the key's scope (organization, or project).
["viewer", "member"]Key expiration timestamp. If not set at creation, defaults to the organization's configured maximum API key lifetime. Cannot exceed the org-level maximum.
Timestamp of the last metadata change (name, roles, status).
Timestamp of the most recent secret rotation. Null if never rotated.
Timestamp of the last successful token mint using this key.
IP address from which the key was last used.
"203.0.113.42"