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

# Authentication

> Authenticate with a workspace API key and the scopes each endpoint needs.

Every request needs an [API key](https://hebeat.com/docs/knowledge-base/api-keys.md) in the `Authorization` header:

```bash theme={null}
curl https://api.hebeat.com/monitors \
  -H "Authorization: Bearer hb_..."
```

A key belongs to one workspace and can only reach that workspace's resources. It also belongs to the person who created it: when they leave the workspace, are removed from it or delete their account, their keys are revoked. Browser session cookies are never accepted by the API, and there is no CORS: call it from your servers, not from browser code.

## Scopes

Each endpoint requires one scope, shown on its page in this reference. A `write` scope includes the `read` scope of the same resource.

| Scope | Endpoints |
| - | - |
| `monitors:read` | `GET /monitors` and every `GET /monitors/{monitor_id}/…` read: checks, metrics, uptime, alerts, transitions, pings, heartbeat uptime |
| `monitors:write` | `POST /monitors`, `PATCH` and `DELETE /monitors/{monitor_id}`, `pause`, `resume`, `test`, `rotate-ping-url` |
| `incidents:read` | `GET /incidents`, `GET /incidents/{incident_id}` |
| `incidents:write` | `acknowledge`, `resolve`, `duplicate`, and `PATCH` (severity and assignee) |
| `notifications:read` | `GET /notification-channels`, `GET /monitors/{monitor_id}/notification-channels` |
| `notifications:write` | Create, update, delete and test channels, resend confirmations, rotate webhook secrets, `PUT /monitors/{monitor_id}/notification-channels` |

`GET /me` works with any valid key and returns its workspace, scopes and API version. A key is also capped by the role of the person who created it, so the scopes in effect can be fewer than the ones it was created with; `GET /me` returns the effective scopes. A key whose creator is no longer a member of the workspace, or is in the Billing role, is rejected as invalid.

The `pages` and `subscribers` scopes can be granted to keys, but the public API has no status page or subscriber endpoints yet.

## Authentication errors

| Status | Code | Meaning |
| - | - | - |
| `401` | `unauthenticated` | The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member of the workspace. |
| `403` | `insufficient_scope` | The key lacks the endpoint's scope. The `WWW-Authenticate` header names the scope needed. |
| `403` | `workspace_blocked` | The key's workspace is blocked. |
| `402` | `workspace_restricted` | The workspace needs billing attention; the owner can fix it in the app. |

See [Errors](https://hebeat.com/docs/api-reference/errors.md) for every error code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.