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

# Authentication

> Learn how to authenticate with the Demomatic dashboard and REST API.

Demomatic has two authentication methods: session-based authentication for the dashboard and API key authentication for the REST API.

## Dashboard authentication

When you sign in to the Demomatic dashboard at [demomatic.tech](https://demomatic.tech), your session is managed automatically. No additional setup is required.

## API key authentication

The Demomatic REST API uses API keys to authenticate requests. Include your API key as a Bearer token in the `Authorization` header of every request.

```http theme={null}
Authorization: Bearer <your_api_key>
```

### Create an API key

<Steps>
  <Step title="Open API key settings">
    In the dashboard, go to **Settings** → **API Keys**.
  </Step>

  <Step title="Create a new key">
    Click **New API key**. Give the key a name and select a permission level:

    * **read\_only** — allows `GET` requests only. Use this for read-only integrations.
    * **all\_access** — allows all request methods including `POST`, `PUT`, and `DELETE`.

    Click **Create**.
  </Step>

  <Step title="Copy your key">
    Copy the API key immediately. For security reasons, the full key is only shown once. Store it in a secure location such as an environment variable or secrets manager.
  </Step>
</Steps>

<Warning>
  API access is available on the **Starter** and **Growth** plans. If you are on a free plan, upgrade your subscription to use the API.
</Warning>

### Make an authenticated request

The following example retrieves your list of videos:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.demomatic.tech/v1/videos \
    -H "Authorization: Bearer <your_api_key>"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.demomatic.tech/v1/videos', {
    headers: {
      'Authorization': 'Bearer <your_api_key>'
    }
  });

  const { data } = await response.json();
  ```

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

  response = requests.get(
      'https://api.demomatic.tech/v1/videos',
      headers={'Authorization': 'Bearer <your_api_key>'}
  )

  data = response.json()['data']
  ```
</CodeGroup>

On success, the API returns a `{ data: <payload> }` response. On failure, it returns `{ error: "<message>" }`.

### Rate limits

The API is rate-limited to **100 requests per 2 minutes** per IP address. If you exceed this limit, the API returns a `429 Too Many Requests` response.

<Info>
  To stay within the rate limit, cache responses where possible and avoid making redundant requests in rapid succession.
</Info>

### Manage your API keys

You can view and delete API keys from **Settings** → **API Keys** in the dashboard. Deleting a key immediately revokes access for any integration using it.

For a full guide on managing API keys, see [API keys](/guides/api-keys).
