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

# Revoke Key

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

## Request

- Base URL: `https://grandline.luzomi.com`
- URL: `https://grandline.luzomi.com/api/v1/auth/keys/{key_id}`
- Auth: none declared

Revoke (soft-delete) one of the caller's API keys.

The row stays in the table — revoked_at is set so the auth middleware
refuses to validate the key from now on, but listing still shows it
for audit. Hard-deleting the row would also remove its `last_used_at`
history which is useful for incident response.

## Path parameters

- `key_id` integer, required

## Response `200`

Successful Response

- ApiKeyRevokeResponse
  - `id` integer, required
  - `revoked_at` string, date-time, required

## Other responses

- `401`: Authentication required
- `404`: Key not found / not owned by caller
- `422`: Validation Error

---

[API](https://skmtc.dev/luzomi/apis/grandline-api.md) · [All operations](https://skmtc.dev/luzomi/apis/grandline-api/llms.txt) · [OpenAPI document](https://skmtc.dev/luzomi/apis/grandline-api/revisions/4ce06aea012b?raw)
