---
agentTools:
  projectIndex: https://elai.readme.io/llms.txt
---

# Authentication

The Elai API uses bearer-token authentication.

Every request needs an `Authorization` header carrying the API token for your workspace:

```http
Authorization: Bearer <API_TOKEN>
```

Find or generate the token in the Elai app under [**Settings → API**](https://app.elai.io/api).

A token is scoped to **one workspace** and authenticates as that workspace's admin user — it is not
tied to an individual person, and it carries admin rights inside that workspace. Rotating it through
[`POST /generateToken`](https://elai.readme.io/reference/generate-api-token) invalidates the previous one immediately.

> ❗️ A bare 401 has three possible causes
>
> A missing, unknown or revoked token all return `401` with **no response body**, and so does a
> workspace on the **Unlimited** plan — that plan cannot use the public API at all. Nothing in the
> response distinguishes them. If a token you just generated returns `401` on every endpoint, check
> the plan before debugging the token.