---
title: "Revoke Key"
method: DELETE
path: "/v1/keys/{key_id}"
tags: ["keys"]
---

# Revoke Key

`DELETE /v1/keys/{key_id}`

## Request

- Base URL: `https://api.craterview.ai`
- URL: `https://api.craterview.ai/v1/keys/{key_id}`
- Auth: HTTP bearer

Stop a key working. Immediate, and not reversible — mint a new one instead.

You cannot revoke the key you are calling with by its id: the request would succeed and
leave you unable to make another. Create a replacement first, move your clients to it,
then revoke this one — or, to end the key you hold on purpose, `DELETE /v1/keys/current`.

Jobs already submitted with the revoked key are unaffected. They belong to the account,
and so does their history.

## Path parameters

- `key_id` string, required

## Response `204`

Successful Response

## Other responses

- `400`: the path, query or a JSON string in the body contains a NUL character or an unpaired surrogate; the body is not JSON encoded as UTF-8, or carries a number JSON cannot represent (NaN, Infinity, or one too large) or nesting too deep to read; or an Idempotency-Key header is longer than 255 characters or not printable ASCII. The request was not read
- `401`: missing, malformed or unrecognised API key
- `404`: no active key of yours with that id
- `409`: that is the key you are calling with
- `413`: the request body is larger than 1 MiB. The request was not read
- `422`: Validation Error
- `502`: the request could not be applied; ask again
- `503`: key management is briefly unavailable; retry the request

---

[API](https://skmtc.dev/craterview/apis/craterview-ai-api.md) · [All operations](https://skmtc.dev/craterview/apis/craterview-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/craterview/apis/craterview-ai-api/revisions/9419a5cd27cd?raw)
