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

# Authentication

> Learn how to authenticate with the Doozy API using API keys

<Warning>
  The Doozy API is currently in **closed beta**. To request access, please email [hello@doozy.live](mailto:hello@doozy.live).
</Warning>

## Enabling API Access

API access is **disabled by default** for all Doozy workspaces. Before any API keys can be generated, an Admin must enable API access:

<Steps>
  <Step title="Open Doozy Settings">
    Navigate to your Doozy dashboard and open **Settings**.
  </Step>

  <Step title="Go to Security">
    Select the **Security** page from the settings menu.
  </Step>

  <Step title="Enable API Access">
    Toggle on the **API Access** option to allow API key generation.
  </Step>
</Steps>

## Creating an API Key

Once API access is enabled, **Admins** and **Managers** can generate API keys:

<Steps>
  <Step title="Open API Settings">
    In your Doozy dashboard, navigate to the API keys section.
  </Step>

  <Step title="Generate New Key">
    Click **Generate API Key** to create a new key.
  </Step>

  <Step title="Copy and Store Securely">
    Copy your API key immediately. For security reasons, the full key is only shown once.
  </Step>
</Steps>

<Warning>
  Store your API key securely. Treat it like a password - never commit it to version control or share it publicly.
</Warning>

## Using Your API Key

Include your API key in the `x-api-key` header with every request:

```bash theme={null}
curl https://api.doozy.live/v1/quizzes \
  -H "x-api-key: dzy_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

### API Key Format

Doozy API keys follow this format:

```
dzy_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

## Access Scoping

API keys inherit the permissions of the user who created them. This means:

* You can only access quizzes, surveys, and other resources that you have permission to view as an Admin or Manager
* If you are removed as an admin from a quiz or survey, your API key will **immediately lose access** to that resource
* Different users' API keys may have access to different resources based on their individual permissions

<Info>
  If you need to access data across your entire workspace, ensure the user generating the API key has appropriate permissions for all resources.
</Info>

## Rotating API Keys

To rotate your API key (recommended periodically for security):

<Steps>
  <Step title="Generate a New Key">
    Create a new API key following the steps above.
  </Step>

  <Step title="Update Your Integrations">
    Replace the old API key with the new one in all your integrations and scripts.
  </Step>

  <Step title="Revoke the Old Key">
    Once all integrations are updated, delete the old API key from your Doozy dashboard.
  </Step>
</Steps>

<Tip>
  Rotate your API keys regularly and immediately if you suspect a key has been compromised.
</Tip>

## Rate Limiting

The Doozy API enforces rate limits to ensure fair usage:

| Limit             | Value |
| ----------------- | ----- |
| Requests per hour | 1,000 |

When you exceed the rate limit, the API returns a `429 Too Many Requests` response. See the [Errors](/api/errors) page for details on handling this.

<Note>
  Rate limits are applied per API key. If you need higher limits, please contact us at [hello@doozy.live](mailto:hello@doozy.live).
</Note>
