# Errors

> Every failed call answers JSON with ok false, a status word, and a message. Here is what each one means.

A failed call answers `{ "ok": false, "status": "...", "message": "..." }` with a matching HTTP
code. Check the HTTP code or `status` first, then show or log `message`. Failed calls are free.

```json
{
  "ok": false,
  "status": "invalid",
  "message": "Unknown sort \"bad\". Use one of: outlier, recent, engagement, views."
}
```

## Every status

| HTTP  | `status`               | What it means                                            | What to do                                                                      |
| ----- | ---------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `202` | `queued`               | Eden is fetching this post for the first time.           | Wait `retry_after_seconds`, then call again.                                    |
| `202` | `indexing`             | Eden is pulling this creator's posts for the first time. | Wait `retry_after_seconds`, then call again.                                    |
| `401` | `auth-expired`         | The key is missing, mistyped, or revoked.                | Check the `Authorization` header, or make a new key.                            |
| `402` | `out-of-credits`       | The key's workspace has no credits left.                 | Show `add_credits_url`.                                                         |
| `403` | `forbidden`            | The key's access doesn't allow this route.               | Change the key's access in **Settings → API**, or make a new key.               |
| `404` | `not-found`            | No post or creator matches, or the route doesn't exist.  | Check the link, id, handle, or path.                                            |
| `409` | `ambiguous`            | More than one account matches the handle.                | Pick one from `candidates` and call again with its `username`.                  |
| `422` | `invalid`              | A query value is missing or wrong. `message` says which. | Fix the value.                                                                  |
| `422` | `unsupported`          | Eden can't read this link.                               | Use a YouTube, Instagram, TikTok, X, LinkedIn, Threads, Substack, or Loom link. |
| `422` | `missing-workspace`    | The key has no workspace to charge.                      | Make a new key in **Settings → API**.                                           |
| `429` | `rate-limited`         | More than 120 calls a minute on this key.                | Wait the seconds in `Retry-After`.                                              |
| `5xx` | `error`, `unavailable` | Something broke on Eden's side.                          | Try again in a moment.                                                          |

## Waiting answers (202)

A `202` is not a failure. It carries `retry_after_seconds` (5 to 60) and the same number in a
`Retry-After` header:

```json
{
  "ok": false,
  "status": "queued",
  "message": "Eden is fetching this post for the first time. Try again shortly.",
  "retry_after_seconds": 10
}
```

A creator that's still being pulled also sends what Eden has so far: `creator`, `posts_found`,
`posts_expected`, and `recent_posts`. See [Creators](https://eden.so/developers/creators/#new-creators).

## Out of credits (402)

```json
{
  "ok": false,
  "status": "out-of-credits",
  "message": "This workspace is out of credits. Add credits to keep calling the Eden API.",
  "add_credits_url": "https://app.eden.so/?settings=usage"
}
```

## More than one match (409)

```json
{
  "ok": false,
  "status": "ambiguous",
  "message": "More than one account matches. Use one of these handles.",
  "candidates": [
    {
      "platform": "instagram",
      "username": "noravale",
      "display_name": "Nora Vale",
      "profile_url": "https://www.instagram.com/noravale/",
      "avatar_url": null,
      "bio": null,
      "followers": 182000
    }
  ]
}
```

## Retry rule of thumb

- `202`: wait `retry_after_seconds` and call again.
- `429` and `5xx`: wait a few seconds and try again, a few times at most.
- Everything else: don't retry. Fix the key, the input, or the balance first.
