Management

Update organization API key

Updates a user-managed API key for the current organization management token.

patch/v1/management/api-keys/{keyId}

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/v1/management/api-keys/{keyId}
  • Auth: HTTP bearer

Path parameters

keyIdstring required

Request body

status'active' | 'inactive' | 'suspended' | 'revoked'

Lifecycle status for the user API key.

namestring

Updated display name. Length must be 1-50 characters after trimming.

limitAmountnumber nullable

Updated spending limit input in USD. null means unlimited and 0 means zero quota.

limitCurrency'USD'

Currency for limitAmount. USD is the only active currency. Sending CNY returns 400 currency_retired.

modelsstring[]

Updated model allowlist.

expiresAtstring date-time nullable

Updated RFC3339 expiry timestamp. null clears the expiry.

deliveryPolicy'auto' | 'verified' | 'official' | 'null' nullable

Per-key Delivery policy. null inherits the Workspace default.

Response

Updated API key

idstring required
namestring required
key_prefixstring required
status'active' | 'inactive' | 'suspended' | 'revoked' required

Lifecycle status for the user API key: active, inactive, or revoked.

limit_amountnumber nullable required

API key spending cap in USD as a JSON number for display. null means unlimited.

used_amountnumber required

Accumulated API key usage in USD as a JSON number for display.

modelsstring[] required
expires_atstring date-time nullable required
last_used_atstring date-time nullable required
created_atstring date-time required
keystring

Returned only on creation

limit_amount_decimalstring nullable required

Exact API key spending cap in USD as a decimal string. null means unlimited.

used_amount_decimalstring required

Exact accumulated API key usage in USD as a decimal string for reconciliation.

delivery_policy'auto' | 'verified' | 'official' | 'null' nullable required

Per-key Delivery policy. null inherits the Workspace default.

Changes

No recorded changes to this operation across all 1 revision of this API.