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

# Errors

> Every error code the API can return, what it actually means, and what to do.

Errors come from two places. The **gateway** decides authentication, access, billing,
rate limiting and routing, and answers with one envelope. If the request gets past
the gateway, the **API you called** may reject it in its own format. Key on the
status code and the machine-readable code, never on the message text, which is
prose and may be reworded.

## Gateway errors

```json theme={null}
{ "error": { "code": "limit_reached", "message": "You have reached your usage limit." } }
```

| Status        | `error.code`          | Meaning                                                                 | What to do                                                                                 |
| ------------- | --------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `401`         | `unauthenticated`     | No credential was sent.                                                 | Check that the `apikey` header is present. An empty shell variable sends the request bare. |
| `401`         | `invalid_credentials` | A key was sent and rejected.                                            | The key is wrong, revoked or expired. Not a routing problem.                               |
| `403`         | `forbidden`           | The key is valid but not granted this API.                              | See [Credits & access](/credits-and-access). Contact Eventory to enable it.                |
| `402`         | `limit_reached`       | Credits exhausted against the hard cap.                                 | Wait for the period to reset or raise the cap. Free endpoints keep working.                |
| `402`         | `no_subscription`     | No active or trialing subscription.                                     | Check `GET /usage`. Paused, cancelled or unpaid subscriptions are not served.              |
| `402`         | `no_billing_account`  | The key has no billing account.                                         | Contact Eventory.                                                                          |
| `402`         | `plan_unavailable`    | The plan is misconfigured.                                              | Contact Eventory.                                                                          |
| `402`         | `payment_required`    | Another billing denial.                                                 | Contact Eventory.                                                                          |
| `400`         | `invalid_parameter`   | A quantity-billed parameter is out of range or malformed.               | Today this is only `sales_limit`, which must be `1..200`.                                  |
| `429`         | `rate_limited`        | More than 30 requests this minute.                                      | Back off. See [Rate limits](/rate-limits).                                                 |
| `404`         | `not_found`           | Unknown route or malformed path. Also returned for a wrong HTTP method. | Check the path and method against the reference.                                           |
| `502` / `503` | `service_unavailable` | The upstream service failed or is unreachable.                          | Retry with backoff. The underlying error is deliberately not forwarded.                    |

Two patterns worth recognising immediately:

* **`401 unauthenticated` on every route** almost always means the key is missing
  from the request, not that it is wrong.
* **`502` on everything** means the gateway could not reach its authentication
  service. It fails closed by design. Retry with backoff.

## Market Data errors

```json theme={null}
{ "status": "error", "code": "EVENT_NOT_FOUND", "message": "No event with id E-1" }
```

| Status | `code`                 | Meaning                                                                                                              |
| ------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `400`  | `INVALID_VIAGOGO_ID`   | The path id does not match `E-<digits>`.                                                                             |
| `400`  | `INVALID_REQUEST`      | Request validation failed: missing or wrong-type body or query fields, or an expression that is too long.            |
| `400`  | `MISSING_URL`          | `GET /artist` called without `url`, or with an empty value.                                                          |
| `404`  | `EVENT_NOT_FOUND`      | No tracked event matches the identifier.                                                                             |
| `404`  | `ARTIST_NOT_FOUND`     | No artist on file with that exact URL.                                                                               |
| `502`  | `BAD_UPSTREAM_REQUEST` | The data backend rejected the request.                                                                               |
| `502`  | `UPSTREAM_AUTH_FAILED` | The data backend rejected the service's own credentials. Not something you can fix; contact Eventory if it persists. |
| `502`  | `EDGE_UPSTREAM_ERROR`  | The data backend returned an error or an unexpected payload.                                                         |
| `503`  | `EDGE_UNAVAILABLE`     | The data backend is unreachable. Retry with backoff.                                                                 |
| `504`  | `EDGE_TIMEOUT`         | The data backend exceeded its timeout. Retry with backoff.                                                           |
| `500`  | `INTERNAL_ERROR`       | Unhandled error. Safe to retry once with backoff.                                                                    |

## Live Availability errors

```json theme={null}
{ "detail": "Scrape timed out after 60s" }
```

| Status | Meaning                                                                                                |
| ------ | ------------------------------------------------------------------------------------------------------ |
| `400`  | Unknown or unsupported platform. Check the value against `GET /events/platforms`.                      |
| `404`  | Event not found on the platform. It may be sold out, expired, removed, or the id is wrong.             |
| `408`  | The platform took longer than 60 seconds. Retry once; if it persists the event id is probably invalid. |
| `500`  | Unexpected error during the scrape.                                                                    |

## Watchlist errors

Validation errors carry `error`; a body that is not valid JSON is rejected earlier
and carries `detail`.

```json theme={null}
{ "error": "invalid event id" }
```

| Status        | Meaning                                                |
| ------------- | ------------------------------------------------------ |
| `400`         | Invalid input, or the body is not a JSON object.       |
| `404`         | No item with that id belongs to your account.          |
| `500`         | Unexpected error. Safe to retry once with backoff.     |
| `502` / `504` | Upstream unreachable or timed out. Retry with backoff. |

## Account errors

| Status | `detail`             | Meaning                                           |
| ------ | -------------------- | ------------------------------------------------- |
| `502`  | `stripe_unavailable` | Billing provider unreachable. Retry with backoff. |
| `502`  | `bad_plan_pricing`   | The plan is misconfigured. Contact Eventory.      |

## Stream errors

The WebSocket returns HTTP errors before the upgrade completes and sends no custom
close frames afterwards. See [Connecting to the stream](/stream/connecting#errors).

## Retry policy

| Status                     | Retry?                                |
| -------------------------- | ------------------------------------- |
| `400`, `401`, `403`, `404` | No. The same request will fail again. |
| `402`                      | No. Fix the billing state first.      |
| `408`                      | Once.                                 |
| `429`                      | Yes, after backing off.               |
| `500`, `502`, `503`, `504` | Yes, with exponential backoff.        |

Paid requests that fail with a `4xx` from the API itself are still billed once, so a
retry loop on a bad request spends credits for nothing.
