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

# Authentication

Every Happy Uptime API request requires a Bearer token. Keys are prefixed with hu_ and scoped to a single project.

# Authentication

All API requests require a Bearer token. API keys are prefixed with `hu_` and are project-scoped.

```bash cURL
curl -H "Authorization: Bearer hu_live_abc123..." \
  https://happyuptime.com/api/v1/monitors
```

```javascript Node
const res = await fetch("https://happyuptime.com/api/v1/monitors", {
  headers: { Authorization: "Bearer hu_live_abc123..." }
});
```

**Auth header format**

Use the header exactly as shown above. Happy Uptime accepts API keys via `Authorization: Bearer hu_...` only. `X-API-Key`, Basic auth, and raw token values are not supported.

## Scopes

Each API key has a scope that determines what operations it can perform.

| Scope | Permissions |
| --- | --- |
| `read` | `GET` endpoints only |
| `write` | `GET` + `POST` + `PUT` + `DELETE` |
| `admin` | Full access including API key management |

## Troubleshooting 401 responses

**Check the base URL**

Use the exact base URL: `https://happyuptime.com/api/v1`. A missing `/api/v1` prefix is the most common cause.
  **Check the header name**

Send `Authorization: Bearer hu_...` on every request — not `X-API-Key`, not Basic auth.
  **Regenerate a lost key**

If a key was copied incorrectly or lost, create a new one in **Dashboard → Settings → API Keys**. Full keys are only shown once.
  **Scope too low? You'll see 403, not 401**

If the request is authenticated but the scope is too low, the API returns `403` instead of `401`.