---
title: "DELETE /api/v1/{context_id}/keys/{key_name}"
method: DELETE
path: "/api/v1/{context_id}/keys/{key_name}"
---

# DELETE /api/v1/{context_id}/keys/{key_name}

`DELETE /api/v1/{context_id}/keys/{key_name}`

Delete the caller's own key by name (or, for a context administrator holding `grant:manage` over `/`, any key). A key that is not the caller's own and that it may not manage surfaces as 404 (no cross-key leakage). Gated by `allow_self_service_keys`; rejects legacy / delegated callers.

## Path parameters

- `context_id` string, required
- `key_name` string, required

## Response `204`

Deleted

## Other responses

- `401` — Unauthorized
- `403` — Self-service keys disabled or ineligible caller
- `404` — Key does not exist or is not owned by the caller
- `422` — Invalid context id
- `503` — Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header.

## Changes

- **2026-08-24** `9f1598713067` — 1 info
  - added the non-success response with the status `503`
- **2026-06-16** `52b41ab517b6` — 1 info
  - endpoint added
- **2026-06-08** `741d58b9ef89` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/surrealdb/apis/spectron/changes/api/v1/:context_id/keys/:key_name/delete.md)

---

[API](https://skmtc.dev/surrealdb/apis/spectron.md) · [All operations](https://skmtc.dev/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/9f1598713067/schema)
