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

# Revoke API Key

> Revoke an API key to permanently disable it

Revoke an API key. The key immediately stops working and webhook deliveries are disabled. This cannot be undone.

## Request Body

<ParamField body="action" type="string" required>
  Must be `revoke`.
</ParamField>

<ParamField body="key_id" type="string" required>
  The UUID of the API key to revoke.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the revocation was successful.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.magpipe.ai/functions/v1/manage-api-keys \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "revoke",
      "key_id": "b007638d-9550-4cc4-b35f-d11632d77d08"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.magpipe.ai/functions/v1/manage-api-keys',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        action: 'revoke',
        key_id: 'b007638d-9550-4cc4-b35f-d11632d77d08',
      }),
    }
  );
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.magpipe.ai/functions/v1/manage-api-keys',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json',
      },
      json={
          'action': 'revoke',
          'key_id': 'b007638d-9550-4cc4-b35f-d11632d77d08',
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true
  }
  ```

  ```json Error Response theme={null}
  {
    "error": "API key not found or already revoked"
  }
  ```
</ResponseExample>
