---
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 one of the caller's own keys by name. A name that does not belong to the caller surfaces as 404 (no cross-principal 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

---

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