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

# Errors & status

> Subscription state changes and the error vocabulary

Two frame types tell you when something about a subscription changes or a
request fails: `status` for subscription state transitions, and `error` for
rejected requests and failed subscriptions.

## `status`

```json theme={null}
{ "type": "status", "v": 1, "serverTimestamp": 1748020034300, "subscriptionId": "f47ac10b-…", "state": "resyncing", "reason": "connectDown" }
```

`state` is one of:

| `state`       | Meaning                                                                                                                                                          |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `live`        | Streaming normally.                                                                                                                                              |
| `resyncing`   | A gap or upstream reconnect occurred. Drop your local book; a fresh `snapshot` follows. (On the [trade channel](/streaming/trades) there is nothing to rebuild.) |
| `closed`      | The market settled / resolved. No more data.                                                                                                                     |
| `unsupported` | This market or side isn't supported for streaming.                                                                                                               |
| `unavailable` | The market couldn't be streamed (terminal).                                                                                                                      |

`reason` is an optional machine-readable hint. When one market-level event
affects several subscriptions on your connection, you get one `status` frame per
affected `subscriptionId`.

## `error`

```json theme={null}
{ "type": "error", "v": 1, "serverTimestamp": 1748020034220, "market": { "venue": "polymarket", "outcomeId": "bad" }, "channel": "book", "code": "UNKNOWN_MARKET", "message": "…" }
```

The addressing fields tell you what the error is about:

* **Active-subscription error** — carries `subscriptionId`.
* **Subscription-creation error** — carries `market` + `channel` (the
  subscription was never created, so there's no id).
* **Connection-level error** — neither; just `code`, `message`, and the
  `requestId` you sent.

### Error codes

Error `code`s are `SCREAMING_SNAKE_CASE` (distinct from the lowercase `status`
`state` values above).

| `code`                | Meaning                                                                                                                                                                                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UNKNOWN_MARKET`      | The `MarketStream` didn't resolve to a real market.                                                                                                                                                                                                                                               |
| `QUOTA_EXCEEDED`      | You hit the [per-connection subscription cap](/streaming/connection#connection-limits). Open another connection.                                                                                                                                                                                  |
| `NOT_AUTHORIZED`      | Not authorized for this operation.                                                                                                                                                                                                                                                                |
| `UNSUPPORTED_CHANNEL` | The requested channel isn't available on this market's venue. Currently returned for a `trade` subscribe on a Limitless market (the venue publishes no public trade feed). The error carries `market` + `channel`; no subscription is created and other entries in the same batch are unaffected. |
| `SERVICE_DEGRADED`    | The service is temporarily degraded (e.g. an upstream link is down). Retry shortly.                                                                                                                                                                                                               |
| `SNAPSHOT_TIMEOUT`    | The initial snapshot didn't arrive in time. Retry the subscribe.                                                                                                                                                                                                                                  |
| `UNAVAILABLE`         | The market is unavailable to stream.                                                                                                                                                                                                                                                              |
| `INTERNAL`            | An internal error. Safe to retry; contact support if it persists.                                                                                                                                                                                                                                 |
