Enable or disable an API Key
Enables or disables an API Key in the organization of the authenticated API Key. Requires an API Key with the OrganizationAdmin role and a RequestId header.
Only status 1 (active) and 2 (disabled) can be requested. Only an active API Key can be disabled, and only a disabled API Key can be enabled; requesting its current status returns 400 InvalidParameter. Disabling requires a non-blank disableReason. An expired API Key cannot be enabled or disabled. A missing API Key, an API Key that was deleted, or an API Key owned by another organization returns 404 APIKeyNotFound.
Authorization
API key for /v1 requests.
Path parameters
API Key ID. API Key IDs returned by this API use the key_ prefix.
^(sk-[A-Za-z0-9_-]{32}|key_[A-Z0-9]{16})$key_0123456789ABCDEFHeaders
Idempotency key for write requests.
Use a globally unique UUID or similar token for each logical write request.
Never reuse a RequestId across different operations or payloads.
You can safely retry the same RequestId only when the method, path, path parameters, query string, and request body are identical.
18f6b0c2e-6a9a-4f2e-9c4c-0a1f9a2b7d31Request body
Requested API Key status. Only active (1) and disabled (2) can be requested. Expired (3) is calculated from expiresAt and cannot be set through this endpoint.
Only an active API Key can be disabled, and only a disabled API Key can be enabled; requesting its current status returns 400 InvalidParameter. To enable an API Key, send status: 1 and omit disableReason. To disable an API Key, send status: 2 with a non-blank disableReason. An expired API Key cannot be enabled or disabled.
Required, after trimming whitespace, when status is 2 (disabled). It is cleared when enabling an API Key.
255Rotation in progress.Response
API Key status updated successfully.
Non-sensitive API Key metadata. This object never includes the plaintext API Key or its stored hash.
status is 1 for active, 2 for disabled, and 3 for expired. An API Key whose expiresAt has passed is returned as expired even if its stored status was previously active.
Child fields
API Key description, when set.
API Key used by the deployment automation service.Reason supplied when the API Key was disabled, when present.
Rotation in progress.Built-in or custom role IDs assigned to the API Key.
["organizationadmin"]Source IP allowlist enforced during API Key authentication. Empty when no allowlist is configured, which allows any source IP address.
["203.0.113.10","2001:db8:100::/64"]ID of the API Key that created this API Key, when available.
key_ABCDEF0123456789Most recent successful authentication time in ISO 8601 format, when available.
2026-04-22T08:30:00ZSource IP address used for the most recent successful authentication, when available.
203.0.113.10Expiration time in ISO 8601 format, when configured.
2027-04-21T08:30:00Z