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

# api_keys.revoke()

> Revoke an API key by ID.

<Warning>
  API keys are deprecated. The SDK can manage them for CLI and direct backend integrations, but cannot use them as its own client credential. New integrations should use [private keys](/content/concepts/authentication) instead.
</Warning>

Revoke a key. Subsequent requests that use the revoked key fail with `AuthenticationError`.

**Required scope: `admin`**

```python theme={null}
result = await mesa.api_keys.revoke(key_id="key_123")
print(result.success)
```

## Options

<ParamField path="key_id" type="str" required>
  API key ID to revoke.
</ParamField>

## Response

<ResponseField name="success" type="bool">
  Whether the operation succeeded.
</ResponseField>
