> ## 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.

# List API Keys

> List all API keys in your account

Retrieve all API keys for your account, including webhook configuration.

## Request Body

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

## Response

<ResponseField name="keys" type="array">
  Array of API key objects.

  <Expandable title="Key object properties">
    <ResponseField name="id" type="string">UUID of the API key.</ResponseField>
    <ResponseField name="name" type="string">Display name of the key.</ResponseField>
    <ResponseField name="key_prefix" type="string">First 8 characters of the key (e.g., `mgp_0357`).</ResponseField>
    <ResponseField name="webhook_url" type="string">Webhook URL, or `null` if not set.</ResponseField>
    <ResponseField name="webhook_secret" type="string">Signing secret for HMAC verification, or `null`.</ResponseField>
    <ResponseField name="is_active" type="boolean">Whether the key is active.</ResponseField>
    <ResponseField name="created_at" type="string">ISO 8601 creation timestamp.</ResponseField>
    <ResponseField name="last_used_at" type="string">ISO 8601 timestamp of last API call, or `null`.</ResponseField>
  </Expandable>
</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": "list"}'
  ```

  ```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: 'list' }),
    }
  );

  const { keys } = await response.json();
  keys.forEach(k => console.log(`${k.name}: ${k.key_prefix}... webhook=${k.webhook_url || 'none'}`));
  ```

  ```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': 'list'}
  )

  for key in response.json()['keys']:
      print(f"{key['name']}: {key['key_prefix']}... webhook={key.get('webhook_url', 'none')}")
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "keys": [
      {
        "id": "b007638d-9550-4cc4-b35f-d11632d77d08",
        "name": "Production",
        "key_prefix": "mgp_0357",
        "webhook_url": "https://your-server.com/webhook",
        "webhook_secret": "whsec_example00000000000000000000...",
        "is_active": true,
        "created_at": "2026-02-18T06:09:30.462859+00:00",
        "last_used_at": "2026-02-18T10:05:06.609+00:00"
      },
      {
        "id": "3a08acc2-ff3b-40db-83b5-53840e802da5",
        "name": "Testing",
        "key_prefix": "mgp_c232",
        "webhook_url": null,
        "webhook_secret": null,
        "is_active": true,
        "created_at": "2026-02-11T23:28:20.111629+00:00",
        "last_used_at": null
      }
    ]
  }
  ```
</ResponseExample>
