DocsAPI ReferenceUpdate an API key
PATCH/api/v1/api-keys/{key_id}

Updates the `name` or `expires_at` for an API key. The secret itself cannot be changed — revoke and recreate if you need a new secret.

Path Parameters

key_idintegerrequirede.g. 42

Key integer ID.

Headers

X-API-Keystringrequired

Your workspace API key.

Content-Typestringrequired

Must be `application/json`.

Request Body

application/json

namestring

New label.

Example: "Staging Key"

expires_atstring

New expiry. Set to `null` to remove expiry.

Example: "2028-01-01T00:00:00Z"

Responses

200Updated key metadata.
404Key not found in this workspace.