> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drin.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an API key

> DELETE /v1/api-keys/{id} — revoke a key. Access is cut immediately; the row is kept for the audit trail.

Revoke a key. The next request it makes is rejected immediately. This is a soft delete — the row is retained for the audit trail (who sent what, last-used, revoked-at) but disappears from the list.

**`DELETE /v1/api-keys/{id}`**

## Path parameters

<ParamField body="id" type="string" required>
  The key `id` (e.g. `ak_7Yq3Lm`) to revoke — not its secret.
</ParamField>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.drin.run/v1/api-keys/ak_7Yq3Lm \
    -X DELETE \
    -H "Authorization: Bearer $DRIN_API_KEY"
  ```

  ```typescript Node.js theme={null}
  import { DrinClient } from "@drin00/sdk";

  const drin = new DrinClient({ apiKey: process.env.DRIN_API_KEY });

  await drin.apiKeys.revoke("ak_7Yq3Lm");
  ```
</CodeGroup>

## Response

Returns `204 No Content` on success. The operation is idempotent — revoking an already-revoked key still succeeds. A revoked key is dropped from [List API keys](/api-reference/api-keys/list) and any further request it makes returns `401`.

## Errors

<ParamField body="404 not_found" type="error">
  No key with that id exists in your account.
</ParamField>

<ParamField body="409 conflict" type="key_in_use">
  You tried to delete the key authenticating this request. Use a different key to revoke it, so you don't cut your own access mid-call.
</ParamField>

<ParamField body="409 conflict" type="key_internal">
  The target is an internal service key (e.g. the credential the dashboard runs on) and can't be revoked through this API.
</ParamField>

<Warning>
  **Revocation is immediate and irreversible.** There is no un-revoke. Any service still holding the secret will start getting `401` on its next request, so rotate it in your deployments before (or right as) you revoke.
</Warning>
