# Authentication

Every operation requires a personal API key from the CreatorHero dashboard. The OpenAPI security scheme is named `ApiKey`. The key acts with the key owner's current permissions: an action the owner cannot take in the dashboard is an action the key cannot take either.

Send the key in the `X-API-Key` header. HTTP header names are case-insensitive. The documented name is `X-API-Key`.

```bash
curl https://backend.creatorhero.com/dashboard/api/v1/me \
  -H "X-API-Key: $CREATORHERO_API_KEY"
```

```javascript
const response = await fetch("https://backend.creatorhero.com/dashboard/api/v1/me", {
  headers: {
    "X-API-Key": process.env.CREATORHERO_API_KEY,
  },
});

if (!response.ok) {
  throw new Error(`CreatorHero API ${response.status}`);
}

const me = await response.json();
```

Keep the key on your server. Do not send it as a query parameter, and do not embed it in a browser app. The API reference playground on each operation can send the key with requests you make from these docs.

:::warning

- No key, or a wrong key: `401`.
- An operation that is not available with an API key: `403`.

:::

## Who the key acts as

`GET /dashboard/api/v1/me` returns the caller. `role` is `OWNER` or `TEAM_MEMBER`. `memberRole` is `Admin`, `Leader`, or `Member`.

The key acts as you, with your permissions. A team member's key sees only what that member can see. It does not give them the owner's access.

## What a key cannot do

Some parts of the dashboard are not available with an API key, such as billing, shifts, and adding creators. Those operations return `403`. The [API Reference](/api) lists only the operations a key can use.

## Permissions

Permissions are set per creator and per feature. A `403` on a creator means you don't have permission for that creator, or the creator's plan doesn't include the feature.

To see what you can do, read your permissions:

| Operation | What it returns |
| --- | --- |
| `GET /dashboard/api/v1/team/permissions/{memberId}` | The permission profile for a team member |
| `GET /dashboard/api/v1/creators/permissions` | The creator permissions that exist |
| `GET /dashboard/api/v1/creators/{creatorId}/permissions` | Permissions granted on one creator |
| `GET /dashboard/api/v1/roles` | Team roles |

Those operations are under [Permissions](/api/permissions), [Creator permissions](/api/creator-permissions-api), and [Roles](/api/dashboard-role-api).
