v2 error responses follow a consistent JSON format. Success responses use a consistent { "data": ... } envelope; the payload inside data differs by endpoint and is shown in each endpoint's documentation.
Success Response (example):
{
"data": {
"year": 2026,
"week": 11,
"schedule": []
}
}Error Response:
All REST errors use the same envelope. timestamp is a Unix epoch in milliseconds; path is the request path without query parameters.
{
"error": {
"code": "SC1",
"message": "No schedule found in the database for the given week & year.",
"timestamp": 1717516800000,
"path": "/api/v2/schedule"
}
}This applies to route handlers, query validation (AP4), authentication (AU*), and rate limits (RL*).
| Code | Error | Description |
|---|---|---|
AP1 |
Api_InternalError |
Internal server error |
AP2 |
Api_MethodNotAllowed |
Method not allowed (API tokens are GET-only) |
AP3 |
Api_NotFound |
404 Not Found |
AP4 |
Api_InvalidQuery |
Invalid query parameters |
| Code | Error | Description |
|---|---|---|
SC1 |
Sched_NoSchedule |
No schedule found in the database for the given week & year |
SC2 |
Sched_InvalidParams |
Invalid year or week parameter |
SC3 |
Sched_NoSearchInput |
Missing search query parameter |
SC4 |
Sched_SearchTooShort |
Search query must be at least 3 characters long |
| Code | Error | Description |
|---|---|---|
VD1 |
Vod_NoVod |
No vod found with the given stream id |
VD2 |
Vod_NoVods |
No vods found in the database |
| Code | Error | Description |
|---|---|---|
AU1 |
Auth_MissingHeader |
Missing or invalid authorization header |
AU2 |
Auth_InvalidToken |
Invalid or expired API token |
AU3 |
Auth_TokenRegenFailed |
Failed to regenerate token |
AU4 |
Auth_MissingUserData |
User ID and username are required |
AU5 |
Auth_TokenGenFailed |
Failed to generate token |
AU6 |
Auth_TokenDelFailed |
Failed to delete token |
AU8 |
Auth_AccountBlocked |
Account is blocked |
AU9 |
Auth_MissingHeaderDetailed |
Missing or invalid authorization header. Use: Authorization: Bearer YOUR_TOKEN |
AU10 |
Auth_InvalidTokenFormat |
Invalid token format |
AU11 |
Auth_InvalidExpiredToken |
Invalid or expired API token |
AU12 |
Auth_InternalError |
Internal server error during authentication |
AU13 |
Auth_ConfigurationError |
Configuration error. Please check Twitch settings |
AU14 |
Auth_MissingAuthCode |
Authorization code missing |
AU15 |
Auth_OriginNotAllowed |
Browser origin is not allowed for this authentication request |
| Code | Error | Description |
|---|---|---|
RL2 |
RateLimit_TooManyRequests |
Too many requests from this API token |
RL3 |
RateLimit_Strict |
Rate limit exceeded: Maximum 30 requests per minute |
RL4 |
RateLimit_Standard |
Rate limit exceeded: Maximum 100 requests per minute |
RL5 |
RateLimit_Generous |
Rate limit exceeded: Maximum 300 requests per minute |
RL6 |
RateLimit_Burst |
Rate limit exceeded: Maximum 10 requests per 10 seconds |
RL7 |
RateLimit_Sensitive |
Rate limit exceeded: Maximum 2 requests per 10 seconds |
RL8 |
RateLimit_SearchMinute |
Rate limit exceeded: Maximum 6 requests per minute |
RL9 |
RateLimit_BlogFeedMinute |
Rate limit exceeded: Maximum 16 requests per minute |
| Code | Error | Description |
|---|---|---|
SB1 |
Sub_NoActiveSubathon |
No active subathon found |
SB2 |
Sub_NoParams |
Year parameter is required |
SB3 |
Sub_InvalidParams |
Invalid year parameter or year cannot be in the future |
SB4 |
Sub_NoSubathon |
No subathon found for the specified year |
| Code | Error | Description |
|---|---|---|
BL1 |
Blog_NoBlogData |
No blog data found |
GET https://neuro.appstun.net/api/test/geterror
Get a specific error response by providing an error code. This endpoint is useful for testing error handling in your application and understanding the error response format.
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | No | Error code to retrieve (e.g., "AP1", "SC1", etc.) |
GET https://neuro.appstun.net/api/test/geterror?code=AP1
GET https://neuro.appstun.net/api/test/geterror?code=SC1
GET https://neuro.appstun.net/api/test/geterrorWhen a valid error code is provided:
{
"error": {
"code": "AP1",
"message": "Internal server error",
"timestamp": 1717516800000,
"path": "/api/test/geterror"
}
}When an invalid or missing error code is provided:
{
"error": "Not Found"
}- This endpoint uses status code
418 I'm a teapotfor valid error codes as a testing convention - Returns
404 Not Foundfor invalid or missing error codes - Rate limited using standard tier (100 requests per minute)
- No authentication required
- Missing Token: Returns
AU1orAU9with detailed instructions - Invalid Token: Returns
AU2orAU11for expired/invalid tokens - Token Format: Returns
AU10for malformed authorization headers - Account Issues: Returns
AU8for blocked accounts
The API implements multiple rate limiting tiers:
- Burst Protection: 10 requests per 10 seconds (
RL6) - Sensitive Endpoint Burst: 2 requests per 10 seconds (
RL7) - Search Minute Tier: 6 requests per minute (
RL8) - Strict Tier: 30 requests per minute (
RL3) - Standard Tier: 100 requests per minute (
RL4) - Generous Tier: 300 requests per minute (
RL5)
- Schedule / Subathon / VOD: invalid or missing query parameters return
AP4; missing resources return domain codes (SC1,SB4,VD1, …)
The WebSocket API uses two different error formats:
- Ticket endpoint (
GET /api/v2/ws/ticket): Standard JSON errors with API codes (AU*,RL*) - WebSocket handshake (
WSS /api/v2/ws): Plain text HTTP errors (non-JSON) - WebSocket message validation: Structured WebSocket messages with
type: "invalid"
404 Not Found(invalid WebSocket path)401 Missing authentication (ticket or token required)401 Invalid or expired ticket401 Invalid or expired token429 Connection limit reached (max 5)500 Authentication error500 Upgrade failed
{
"type": "invalid",
"data": {
"reason": "malformed",
"message": "Could not parse message."
}
}Possible reason values include malformed payloads and missing event type fields.
Encountering unexpected errors despite sending correct data?
Open an issue or start a discussion.