---
title: "Revoke Api Key Endpoint"
method: DELETE
path: "/auth/api-keys/{key_id}"
---

# Revoke Api Key Endpoint

`DELETE /auth/api-keys/{key_id}`

## Request

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

Revoke an API key. Cannot revoke the last key.

Uses authenticate_user so the ownership check compares real user ids —
under bare authenticate() `id` was the api_keys row id, which 404'd the
legitimate owner on every API-key-authed revoke.

## Path parameters

- `key_id` integer, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/n0brains/apis/n0brains-signals-api.md) · [All operations](https://skmtc.dev/n0brains/apis/n0brains-signals-api/llms.txt) · [OpenAPI document](https://skmtc.dev/n0brains/apis/n0brains-signals-api/revisions/ac21b5aebd10?raw)
