Enable/disable a key or rebind its group. Optional `If-Match` for optimistic concurrency

Changed on
patch/api/v1/admin/keys/{id}

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header x-admin-token
    • HTTP bearer

Path parameters

idstring required

Headers

If-Matchstring

Optimistic concurrency: the resource's ETag from a prior read (or the ETag returned by the previous mutation). Stale = 409 version_conflict (re-read and retry), nothing changes; absent or * = unconditional.

Request body

enabledboolean nullable
groupstring nullable

Rebind or UNBIND the key's group. Absent = unchanged; null = unbind. The double Option is what distinguishes those two, so the schema describes it as a nullable string.

Response

Updated metadata

allowed_poolsstring[] nullable required
created_atinteger required
enabledboolean required
groupstring nullable required
idstring required
labelsobject required
namestring required
statestring required

enabled alone cannot distinguish a reversible pause from either of the two permanent dispositions. PATCH {enabled:false}, POST /keys/{id}/revoke, and DELETE /keys/{id} all used to leave enabled: false with nothing else to tell them apart. One of exactly four values, additive and derived (never independently settable):

  • "active": enabled, not revoked, not deleted.
  • "disabled": PATCH {enabled:false}. Reversible: PATCH {enabled:true} restores it.
  • "revoked": POST /keys/{id}/revoke. Permanent: denylisted, but the binding row (and GET /keys/{id}) stays live for audit/usage attribution.
  • "tombstoned": DELETE /keys/{id}. Permanent: denylisted AND hard-deleted; the row is kept only so id-attributed billing/audit history keeps resolving. Omitted from a plain GET /keys by default; visible there with ?include=tombstoned.

Changes

    • breaking

      added required request body

    • breaking

      the response property became nullable for the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      api operation id PatchKeysId was added

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status