# API errors

Every problem the Page Lemon API and MCP server return has one of these 31 keys, an HTTP status and a page. The problem's `type` member is the address of its page, and clients branch on `key` and nothing else. A problem may also carry a `reason` member for support; it is not part of the contract.

| Key | Status | What a client does |
|---|---|---|
| [`already_exists`](/docs/errors/already-exists) | `409` | It is there already: use it, or pick another name. |
| [`approval_required`](/docs/errors/approval-required) | `403` or `409` | A person has to do this: give them the link in the body (`approval`, `protect_url`) or ask them. |
| [`bad_request`](/docs/errors/bad-request) | `400` | Fix the request: unreadable JSON or a bad header. |
| [`banned`](/docs/errors/banned) | `403` or `409` | Stop: the account, workspace or person is suspended or restricted. |
| [`blocked_content`](/docs/errors/blocked-content) | `400` or `422` | Remove the secret or the refused content, then send again. |
| [`commit_unknown`](/docs/errors/commit-unknown) | `503` | Retry with the same `Idempotency-Key`: it answers with what happened. |
| [`confirmation_required`](/docs/errors/confirmation-required) | `409` or `422` | Show the preview and send again with `confirm_token` once the person says yes. An expired or used token: ask again. |
| [`conflict`](/docs/errors/conflict) | `409` | The current state does not allow this; `detail` says what to do first. |
| [`cursor_expired`](/docs/errors/cursor-expired) | `410` | Restart the list or sync from the start. |
| [`forbidden`](/docs/errors/forbidden) | `403` | Stop: this key or person has no right to do this. |
| [`frozen`](/docs/errors/frozen) | `403` or `409` | Open `upgrade_url`, or unfreeze the site or workspace. |
| [`gone`](/docs/errors/gone) | `409` or `410` | It expired, was used or ended: start again. |
| [`human_check_required`](/docs/errors/human-check-required) | `403` | Show the human check, then send again. |
| [`idempotency_in_progress`](/docs/errors/idempotency-in-progress) | `409` | Wait `retry_after_seconds`, then send again with the same `Idempotency-Key`. |
| [`idempotency_mismatch`](/docs/errors/idempotency-mismatch) | `422` | Use a new `Idempotency-Key`. |
| [`insufficient_scope`](/docs/errors/insufficient-scope) | `403` | Use a key with `required_scope` (and `also_required` when named: `people` is the People's data tick). |
| [`internal`](/docs/errors/internal) | `500` | Try again later; report the `request_id`. |
| [`limit_reached`](/docs/errors/limit-reached) | `403` or `409` or `422` or `429` | Remove some, or wait for the cap to free up. |
| [`method_not_allowed`](/docs/errors/method-not-allowed) | `405` | Use another method. |
| [`not_found`](/docs/errors/not-found) | `404` | Check the id. A renamed site names the new `name`. |
| [`plan_limit`](/docs/errors/plan-limit) | `403` or `409` or `429` | Upgrade: `needs_plan` and `offer` say to what. |
| [`precondition_failed`](/docs/errors/precondition-failed) | `412` | Read again (`current`, `version`), then send with that version. |
| [`precondition_required`](/docs/errors/precondition-required) | `428` | Send the version you read (`If-Match`, `etag` or `base_version`). |
| [`rate_limited`](/docs/errors/rate-limited) | `429` | Wait `retry_after_seconds`, then send again. |
| [`reauthentication_required`](/docs/errors/reauthentication-required) | `401` or `403` | Sign in again: a fresh sign-in or a step-up is needed. |
| [`too_large`](/docs/errors/too-large) | `413` or `422` | Send less (`max_bytes`). |
| [`unauthorized`](/docs/errors/unauthorized) | `401` | Sign in, or send a valid credential. |
| [`unavailable`](/docs/errors/unavailable) | `502` or `503` | Retry shortly (`retry_after_seconds`). |
| [`unsupported_media_type`](/docs/errors/unsupported-media-type) | `415` | Send the content type the route takes. |
| [`validation_failed`](/docs/errors/validation-failed) | `400` or `422` | Fix the input: `errors` and `detail` say which. |
| [`version_conflict`](/docs/errors/version-conflict) | `409` | Read again, apply your change, send again. |
