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

# Feed API Authentication

> Authenticate Feed API requests with API keys or M2M Bearer tokens.

## Authentication Methods

The Feed API supports two authentication methods: API keys (for server-to-server integrations) and M2M Bearer tokens (for OAuth-based flows).

## API Key (Recommended)

Pass your API key in the `X-API-Key` header:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://app.alana.shopping/api/v1/feeds/google \
    -H "X-API-Key: ak_live_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://app.alana.shopping/api/v1/feeds/google", {
    headers: {
      "X-API-Key": "ak_live_your_api_key",
    },
  });
  ```

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

  res = requests.get(
      "https://app.alana.shopping/api/v1/feeds/google",
      headers={"X-API-Key": "ak_live_your_api_key"},
  )
  ```
</CodeGroup>

## M2M Bearer Token

For OAuth-based server integrations, use a Bearer token in the `Authorization` header:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://app.alana.shopping/api/v1/feeds/google \
    -H "Authorization: Bearer your_m2m_token"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://app.alana.shopping/api/v1/feeds/google", {
    headers: {
      Authorization: "Bearer your_m2m_token",
    },
  });
  ```

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

  res = requests.get(
      "https://app.alana.shopping/api/v1/feeds/google",
      headers={"Authorization": "Bearer your_m2m_token"},
  )
  ```
</CodeGroup>

## Required Scopes

| Operation       | Required Scope |
| --------------- | -------------- |
| Read feeds      | `feed:read`    |
| Manage webhooks | `feed:write`   |
| View analytics  | `feed:read`    |

API keys created in the Alana dashboard have `feed:read` by default. To create webhook subscriptions, enable `feed:write` in the key settings.

## Creating API Keys

1. Go to **Settings → API Keys** in your workspace
2. Click **New API Key**
3. Select the `feed:read` and/or `feed:write` scopes
4. Copy the key — it is shown only once

## Error Responses

| Status                  | Meaning                          |
| ----------------------- | -------------------------------- |
| `401 Unauthorized`      | Missing or invalid API key       |
| `403 Forbidden`         | Valid key but insufficient scope |
| `429 Too Many Requests` | Rate limit exceeded (60 req/min) |
