# Revoke API Key

> Revoke a key. It stops working at once.

Requires an API key with the `admin` scope.

N e Not available while acting as a client workspace. API keys are never created, listed or revoked over MCP. A key may revoke itself. The row is kept and the call writes an `audit.api_key.revoked` entry.

## Path Parameters

<ParamField path="key_id" type="string" required>
  The key identifier from List API Keys.
</ParamField>

## Response

Returns `{ "data": { "id", "revoked": true } }`.

<RequestExample>
```bash cURL
curl -X DELETE "https://api.foxreach.io/api/v1/api-keys/cak_abc123" \
  -H "X-API-Key: otr_your_key"
```

```python Python SDK
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
client.api_keys.revoke("cak_abc123")
```

```typescript TypeScript SDK
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
await client.apiKeys.revoke("cak_abc123");
```

</RequestExample>

<ResponseExample>
```json
{ "data": { "id": "cak_abc123", "revoked": true } }
```
</ResponseExample>

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | The key lacks the `admin` or `write` scope, or its creator lacks the required role |
| `403` | Called while acting as a client workspace with `X-Workspace-Id` (`acting_as_forbidden`) |
| `400` | Already revoked |
| `404` | Key not found in this workspace |

## Rate Limit

- **120 requests per minute, shared by every `write` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`write`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns, see [Rate Limiting](/rate-limiting).
