Skip to main content
POST
JavaScript
Rotation swaps the credential under the key: same ID, same name, same scopes, new token. Every token the key issued before this call stops working the moment it returns.
Invalidation is immediate and covers every previous token, not only the latest. Any service still holding the old value starts failing auth on its next request, so update every consumer of the key as part of the same deploy, not after it.

Rotate is also the recovery path

Cadenya never shows a token after the response that minted it. Lost the value? There is nothing to look up, only this call: rotate, capture spec.token, and move on. That is the “lose it, rotate it” rule from the API key model.

Create an API key

The other response that carries a token.

Disable an API key

When you want the key off, not reissued.

Rotate the global API key

The same motion for the account-wide key.

Update an API key

Change scopes without touching the token.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

The workspace the API key belongs to (path).

Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

id
string
required

The API key to rotate. A new token is issued and any existing token is invalidated.

Example:

"apikey_01HXKD2E5NQM3T9AYWCFCSPNQY"

Body

application/json

The body is of type object.

Response

OK

An API key. Every key belongs to exactly one workspace and is managed via the workspace-scoped API key routes. The only exception is the system-managed global account key, which spans all workspaces and is managed via the account global_api_key routes.

metadata
object
required

AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.

spec
object
required

Configuration for an API key.

state
enum<string>
required
read-only

The current lifecycle state of the API key. Output only. Keys are created STATE_ENABLED; use the :disable and :enable actions to transition between states.

Available options:
STATE_UNSPECIFIED,
STATE_ENABLED,
STATE_DISABLED
info
object