---
title: "Revoke a key (\"original\", a key_id, or \"others\" for all but yours)"
method: DELETE
path: "/v1/keys/{key_id}"
tags: ["keys"]
---

# Revoke a key ("original", a key_id, or "others" for all but yours)

`DELETE /v1/keys/{key_id}`

## Request

- Base URL: `https://api.hookdetector.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.hookdetector.com/v1/keys/{key_id}`
- Auth: none declared

Revoke one key at once. You may revoke the key you are calling with, whatever its
scopes (the response says so in current); revoking another needs admin. Never the last
usable key (409 last_active_key: create another first). An unknown or already revoked
key is 404 key_not_found. key_id "others" revokes every key of the account except the
one calling, for a key that leaked, and answers revoked_count and kept. MCP:
revoke_key.

## Path parameters

- `key_id` string, required

## Headers

- `authorization` string, nullable: Bearer hd_... from POST /v1/accounts or POST /v1/keys

## Response `200`

Successful Response

- KeyRevokedOut
  - `key_id` string, required
  - `revoked` boolean, required
  - `revoked_at` string, required
  - `current` boolean, required
  - `message` string, required

## Other responses

- `401`: missing, invalid, revoked or expired API key (code key_expired)
- `403`: the key lacks the scope this call needs (insufficient_scope), or its credit_limit is spent (key_credit_limit_reached)
- `404`: not found on this account
- `409`: conflict with the account's state
- `413`: request body over the size cap
- `422`: invalid input
- `500`: our fault; names the request id

---

[API](https://skmtc.dev/hookdetector/apis/hook-detector.md) · [All operations](https://skmtc.dev/hookdetector/apis/hook-detector/llms.txt) · [OpenAPI document](https://skmtc.dev/hookdetector/apis/hook-detector/revisions/b136a2804d2b?raw)
