You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(errors): align error code reference with canonical Go list
Replace per-page error tables with the authoritative 19 HTTP + 6
WebSocket-frame codes now defined in sharp-api-go/pkg/errcodes.
Remove fabricated codes that never actually shipped: forbidden,
unknown_type, stream_limit_exceeded. Replace bad_request and
invalid_request (deprecated, collapsed server-side) with
validation_error. Document unauthorized, invalid_api_key, and
invalid_token as three distinct auth-failure codes covering admin
bearer, user API key, and Clerk session paths respectively.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
See the full list (19 HTTP codes + 6 WebSocket frame codes, with HTTP statuses) in [API Overview → Error Codes](/en/api-reference/overview#error-codes). `bad_request` and `invalid_request` are deprecated — both were collapsed into `validation_error`.
|`tier_restricted`| 403 | Endpoint or feature is not available on your tier — response includes `tier` and `required_tier`|
323
331
|`not_found`| 404 | Resource not found |
332
+
|`method_not_allowed`| 405 | HTTP method is not supported on this route |
333
+
|`gone`| 410 | Event has ended or expired — use `/api/v1/events` for current events |
324
334
|`unknown_endpoint`| 410 | Wrong API path — response includes `correct_endpoint` with the right route (e.g. `/api/v1/arbitrage` → `/api/v1/opportunities/arbitrage`) |
325
-
|`upstream_error`| 502 | Temporary data fetch issue |
326
-
|`internal_error`| 500 | Server error |
335
+
|`validation_error`| 400 | Request body or query parameters failed validation |
|`concurrent_request_cap`| 429 | Too many in-flight requests for your tier — reduce parallelism or upgrade |
338
+
|`too_many_streams`| 429 | Maximum concurrent SSE or WebSocket streams exceeded for this API key |
339
+
|`backpressure`| — | Emitted as an SSE `event: error` (not an HTTP status) when the client cannot keep up; server then closes the stream |
340
+
|`upstream_error`| 502 | Temporary issue reaching an upstream sportsbook or auth provider |
341
+
|`service_unavailable`| 503 | A required service (e.g. key management) is not configured or is offline |
342
+
|`internal_error`| 500 | Unexpected server error — retry with backoff and contact support with `X-Request-Id` if it persists |
343
+
344
+
<Callouttype="info">
345
+
`bad_request` and `invalid_request` are **deprecated** — both were collapsed into `validation_error`. Clients that match on the old strings should add `validation_error` to their error map.
346
+
</Callout>
347
+
348
+
### WebSocket frame error codes
349
+
350
+
Emitted only inside `{"type": "error", "code": "..."}` frames on an open WebSocket connection. They describe client-protocol mistakes and do not correspond to an HTTP status.
351
+
352
+
| Code | Meaning |
353
+
|------|---------|
354
+
|`invalid_message`| Frame could not be parsed as JSON or did not match the expected shape |
355
+
|`unknown_message_type`|`type` field is not one of the documented values (`auth`, `subscribe`, `filter`, `refresh_token`, `ping`) |
356
+
|`missing_token`|`auth` or `refresh_token` frame did not include a `token` field |
357
+
|`missing_channels`|`subscribe` frame did not include a non-empty `channels` array |
358
+
|`not_authenticated`| Frame requires an authenticated session (sent `subscribe`, `filter`, or `refresh_token` before `auth`) |
359
+
|`already_authenticated`| Client sent a second `auth` frame after the first one succeeded |
Copy file name to clipboardExpand all lines: content/en/api-reference/websocket.mdx
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -567,11 +567,24 @@ Error notification. The connection may remain open (for non-fatal errors) or clo
567
567
{
568
568
"type": "error",
569
569
"seq": 152,
570
-
"code": "unknown_type",
570
+
"code": "unknown_message_type",
571
571
"message": "Unknown message type: foobar"
572
572
}
573
573
```
574
574
575
+
The WebSocket layer emits a small, fixed set of frame-level error codes for client-protocol mistakes. They are distinct from the HTTP error codes returned by REST endpoints.
576
+
577
+
| Code | Meaning |
578
+
|------|---------|
579
+
|`invalid_message`| Frame could not be parsed as JSON or did not match the expected shape |
580
+
|`unknown_message_type`|`type` field is not one of `auth`, `subscribe`, `filter`, `refresh_token`, `ping`|
581
+
|`missing_token`|`auth` or `refresh_token` frame did not include a `token` field |
582
+
|`missing_channels`|`subscribe` frame did not include a non-empty `channels` array |
583
+
|`not_authenticated`| Sent `subscribe`, `filter`, or `refresh_token` before `auth` succeeded |
584
+
|`already_authenticated`| Client sent a second `auth` frame after the first one succeeded |
585
+
586
+
WebSocket frames may also carry the HTTP-style `invalid_api_key`, `tier_restricted`, and `too_many_streams` codes — these cause the server to close the connection after the frame is sent. See [API Overview → Error Codes](/en/api-reference/overview#error-codes) for the full list.
Copy file name to clipboardExpand all lines: content/en/authentication.mdx
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,16 +134,22 @@ Authenticated requests receive higher rate limits based on your subscription tie
134
134
135
135
## Error Codes
136
136
137
+
Auth-related codes you'll see most often. For the full list of 19 HTTP codes plus the 6 WebSocket frame codes, see [API Overview → Error Codes](/en/api-reference/overview#error-codes).
138
+
137
139
| Code | HTTP Status | Description |
138
140
|------|-------------|-------------|
139
-
|`unauthorized`| 401 | API key missing or invalid |
0 commit comments