OpenRCS API reference · v1 ← Back to console Swagger UI
Accounts

Revoke an API key

DELETE /account/api-keys/{key_id} bearer_auth

Semantically revokes the key: disables it in the key store and flips its stored status to `revoked` (auditable; there is no un-revoke route). Any key of the account is revocable — there is no primary — except the account's LAST active key (`409`, min-1 rule). Re-deleting an already-revoked key is an idempotent `200` with its current state. Requires `status: ready`.

Parameters

NameInTypeRequiredDescription
Authorization header string yes `Bearer <token>` obtained from `POST /login`.

Responses

StatusDescription
200 The key's post-revoke state (no value).
401 Missing or invalid credentials.
404 Unknown key id or key owned by another account.
409 The target is the account's LAST active key (`cannot revoke the last active key`), or the account is not ready yet (`account not ready`).
502 Internal error while disabling the key.

200 example

{
  "id": "ak_2",
  "name": "key-2",
  "status": "revoked",
  "created_at": "2026-09-16T12:00:00Z",
  "revoked_at": "2026-09-17T08:00:00Z"
}

409 example

{
  "error": "cannot revoke the last active key"
}