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

# Authenticate with the ErynoaGroup API

> Learn how to generate ErynoaGroup API keys, set the Authorization header correctly, manage key scopes, and safely rotate or revoke credentials.

ErynoaGroup authenticates API requests using API keys passed as Bearer tokens in the `Authorization` header. This guide explains how to create keys, use them in requests, manage scopes, and handle authentication errors.

## Generate an API key

<Steps>
  <Step title="Open your dashboard">
    Log into your ErynoaGroup dashboard at [erynoa.group](https://erynoa.group).
  </Step>

  <Step title="Navigate to API Keys">
    Go to **Settings → API Keys** and click **Create API Key**.
  </Step>

  <Step title="Configure the key">
    Give your key a descriptive name (e.g., `production-backend`, `ci-pipeline`). Select the appropriate scope:

    | Scope   | Permissions                                          |
    | ------- | ---------------------------------------------------- |
    | `read`  | List and retrieve resources only                     |
    | `write` | Create, update, and delete resources                 |
    | `admin` | Full access including managing API keys and webhooks |
  </Step>

  <Step title="Copy and store your key">
    Your key is shown only once. Copy it immediately and store it securely — in an environment variable, a secrets manager, or a vault.

    <Warning>
      Never commit API keys to version control or expose them in client-side code.
    </Warning>
  </Step>
</Steps>

## Use your API key

Include your API key in the `Authorization` header as a Bearer token on every request:

```bash theme={null}
curl -X GET https://api.erynoa.group/v1/resources \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
```

<Tip>
  Store your API key as an environment variable and reference it in your code:

  ```bash theme={null}
  export ERYNOA_API_KEY="sk_live_YOUR_API_KEY"
  ```

  ```bash theme={null}
  curl -X GET https://api.erynoa.group/v1/resources \
    -H "Authorization: Bearer $ERYNOA_API_KEY"
  ```
</Tip>

## Authentication errors

| HTTP Status        | Error Code           | Meaning                                              |
| ------------------ | -------------------- | ---------------------------------------------------- |
| `401 Unauthorized` | `invalid_api_key`    | Key is missing, malformed, or does not exist         |
| `401 Unauthorized` | `api_key_expired`    | Key has been rotated and is no longer valid          |
| `403 Forbidden`    | `insufficient_scope` | Key lacks the permission required for this operation |

An authentication error response looks like:

```json theme={null}
{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key provided is invalid or has been revoked.",
    "status": 401
  }
}
```

## Rotate or revoke a key

To rotate a key:

1. Create a new key in **Settings → API Keys**
2. Update your application to use the new key
3. Revoke the old key by clicking **Revoke** next to it in the dashboard

Revoking a key immediately invalidates it — any requests using the old key will receive a `401` response.

## Multiple keys

You can create multiple API keys for different applications, environments, or team members. This lets you:

* Audit which application made which request
* Revoke access for a specific service without affecting others
* Use read-only keys for services that only need to query data
