Hoppa till innehållet

Revoke a key

DELETE/v1/tokens/{id}

TypeScript sendora.tokens.revoke(tokenId)

Python sendora.tokens.revoke(token_id)

PHP $sendora->tokens->revoke($tokenId)

Java sendora.tokens().revoke(tokenId)

Key sk_… a server key

The key stops working at once. The last live key of a server cannot be revoked, so a server is never locked out; revoking a key that is already revoked is fine.

Parameters

  • idin pathstring (uuid)required

    The key id.

Responses

Errors

Every error answers error, the code, and message, a sentence for a person. A code that adds fields is shown in full below the table.

CodeStatusMeaning
unauthorized401The key is missing, malformed or revoked.
wrong_token_kind403The key is of the other kind: a server key (sk_) where an account key (ak_) is needed, or the reverse. The message names the kind the operation takes.
not_for_connections403A connected app called an operation that no tool of the MCP server calls. An API key can.
read_only_connection403A connected app may only read here: the account is read only through a connection, and a live server takes changes only if the person allowed them when connecting.
test_server_only403A connected app may create a secret, or do what cannot be undone, on a test server only.
not_found404No such key of this server.
last_token409This is the only live key of the server; create another before revoking it.
  • WWW-Authenticateheader on 401"Bearer"

    Always Bearer: send the key as Authorization: Bearer <key>.