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

# API auth troubleshooting

> Fix Atoll API authentication, missing org IDs, malformed bearer tokens, permission errors, and plan limit errors.

## Check the token

```bash theme={null}
curl -H "Authorization: Bearer $ATOLL_API_KEY" \
  https://atollhq.com/api/auth/me
```

If this fails, the key is missing, malformed, revoked, or for a different environment.

## Check org-scoped access

```bash theme={null}
: "${ATOLL_API_KEY:?missing}" "${ATOLL_ORG_ID:?missing}" && \
  curl -sS -o /dev/null -w "HTTP:%{http_code}\n" \
    "https://atollhq.com/api/orgs/$ATOLL_ORG_ID/issues?limit=1" \
    -H "Authorization: Bearer $ATOLL_API_KEY"
```

Expected:

```text theme={null}
HTTP:200
```

## 401 Unauthorized

Common causes:

* Missing `Authorization` header
* Missing `Bearer` prefix
* Revoked key
* Empty `ATOLL_ORG_ID` causing a malformed route
* Key belongs to another environment

## 403 Forbidden

The key is valid, but the member cannot perform the operation. Check role and project access.

## 404 Not found

The resource may not exist, or the current member may not be allowed to see it.

## 402 Plan limit reached

The organization has hit a plan limit. The response includes `resource`, `plan`, `limit`, and `usage`.

Upgrade the plan or reduce usage before retrying the creation request.
