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

# Revoke an API Key

> Stop an API key from working, and keep a record of it

Revokes a key. It stops working immediately, but stays in the list with `is_active: false` so you keep a record of it. Revoking can't be undone.

Revoke a key as soon as it may have leaked, or when the tool that used it is retired.

## Path parameters

<ParamField path="id" type="string" required>
  The key's ID.
</ParamField>

## Response

`204 No Content`

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.sabaothcloud.com/api/v1/api-keys/KEY_ID/revoke \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```text 204 theme={null}
  (no content)
  ```

  ```json 404 theme={null}
  {
    "error": "NotFound",
    "message": "API key not found"
  }
  ```
</ResponseExample>

## Replacing a key

1. [Create a new key](/api-reference/api-keys/create) with the same scopes.
2. Update the tools that use the old key.
3. Revoke the old key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.