Skip to content

Error Codes

Aleatoric Data returns structured error responses across all four transport protocols. Each protocol uses its native error encoding while maintaining a consistent semantic mapping. This reference documents every error code, its meaning, and the recommended client action.

All errors fall into one of five categories:

CategoryDescriptionClient Action
AuthenticationAPI key missing, invalid, expired, or revokedVerify key, regenerate if needed
AuthorizationKey valid but lacks required scope or tierUpgrade tier or request scope
ValidationMalformed request, invalid parametersFix request and retry
Rate LimitingToken bucket exhausted or concurrent limit hitBack off and retry after indicated interval
ServerInternal error, upstream failure, maintenanceRetry with exponential backoff

All REST and JSON-RPC-over-HTTP responses use standard HTTP status codes:

CodeNameCategoryDescriptionRecommended Action
200OKRequest succeeded
201CreatedResource created (e.g., new subscription registered)
204No ContentSuccess with no response body (e.g., DELETE)
400Bad RequestValidationRequest body or query parameters are malformedCheck request format, validate against schema
401UnauthorizedAuthenticationAPI key is missing, invalid, or expiredInclude a valid Authorization: Bearer <key> header
403ForbiddenAuthorizationAPI key is valid but lacks the required scope or tierUpgrade your plan or contact support for scope adjustment
404Not FoundValidationRequested resource (coin, feed, endpoint) does not existVerify the resource identifier and endpoint path
405Method Not AllowedValidationHTTP method not supported for this endpointUse the correct HTTP method (GET, POST, etc.)
408Request TimeoutServerServer did not receive the complete request in timeRetry; check network connectivity
413Payload Too LargeValidationRequest body exceeds the 1 MB limitReduce payload size; split into multiple requests
422Unprocessable EntityValidationRequest is syntactically valid but semantically incorrectCheck parameter values, types, and ranges
429Too Many RequestsRate LimitingToken bucket exhaustedWait for Retry-After seconds, then retry
500Internal Server ErrorServerUnexpected server-side failureRetry with exponential backoff; report if persistent
502Bad GatewayServerUpstream node or service unreachableTry an alternate region; retry after 5s
503Service UnavailableServerMaintenance or capacity overloadCheck status page; retry after Retry-After
504Gateway TimeoutServerUpstream service did not respond within the deadlineRetry; if persistent, the upstream feed may be down

All 4xx and 5xx responses return a consistent JSON structure:

{
"error": "error_code_string",
"message": "Human-readable description of the error.",
"details": {
"field": "coin",
"reason": "Unknown coin identifier: INVALID"
},
"request_id": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-13T14:22:01.003Z"
}

The details object is present only for validation errors (400, 422) and contains field-level diagnostics. The request_id is included in every error response and should be referenced when contacting support.


JSON-RPC 2.0 errors are returned in the error object of the response. Standard specification codes are in the range [32768,32000][-32768, -32000]. Aleatoric application-specific codes use the range [32099,32000][-32099, -32000].

CodeNameDescription
-32700Parse ErrorServer received invalid JSON that could not be parsed
-32600Invalid RequestJSON was valid but is not a conformant JSON-RPC 2.0 request (missing jsonrpc, method, or id fields)
-32601Method Not FoundThe requested method does not exist or is not available on this endpoint
-32602Invalid ParamsMethod parameters are missing, have wrong types, or fail validation
-32603Internal ErrorUnspecified server-side error during method execution
CodeNameDescription
-32000Rate Limit ExceededAPI key has exhausted its token bucket; includes retry_after in data
-32001Authentication FailedAPI key is missing or invalid
-32002Tier RestrictedMethod or parameter combination requires a higher tier
-32003Coin Not FoundThe specified coin identifier is not tracked by Aleatoric
-32004Feed UnavailableThe requested feed is temporarily offline or not yet initialized
-32005Subscription LimitMaximum number of concurrent subscriptions reached for this key
-32006Batch Too LargeBatch request exceeds the 100-call limit
-32007Snapshot Too LargeRequested depth snapshot exceeds the maximum permitted size
-32008Invalid Time RangeThe start/end parameters define an invalid or excessively large time window
-32009Upstream TimeoutAn upstream data source did not respond within the deadline
-32010Maintenance ModeThe service is in scheduled maintenance; retry after the window
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32003,
"message": "Coin not found: INVALID",
"data": {
"param": "coin",
"provided": "INVALID",
"hint": "Use GET /v1/meta/coins for the list of supported identifiers"
}
}
}

In a JSON-RPC batch, each call is processed independently. A batch response may contain a mix of successful results and errors:

[
{
"jsonrpc": "2.0",
"id": 1,
"result": { "mid": 87234.50, "spread_bps": 1.2 }
},
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32003,
"message": "Coin not found: SHIB"
}
}
]

gRPC responses use the standard google.rpc.Status code set. Additional context is provided via google.rpc.ErrorInfo detail messages.

CodeStatus NameCategoryDescriptionRecommended Action
0OKSuccess
1CANCELLEDClient cancelled the requestNo action needed
2UNKNOWNServerUnknown server errorRetry with backoff; report if persistent
3INVALID_ARGUMENTValidationRequest parameters are invalidFix parameters and retry
4DEADLINE_EXCEEDEDServerServer could not complete within the client’s deadlineIncrease deadline or retry
5NOT_FOUNDValidationRequested coin, feed, or resource does not existVerify identifiers
7PERMISSION_DENIEDAuthorizationAPI key lacks required scope or tier for this RPCUpgrade tier or request scope
8RESOURCE_EXHAUSTEDRate LimitingRate limit or concurrent connection limit exceededBack off per retry-after-ms metadata
10ABORTEDServerOperation aborted due to a conflict (e.g., concurrent snapshot)Retry immediately
11OUT_OF_RANGEValidationRequest parameter outside valid range (e.g., depth > 1000)Adjust parameters
12UNIMPLEMENTEDValidationMethod exists in proto but is not yet availableCheck documentation for availability
13INTERNALServerInternal server errorRetry with backoff
14UNAVAILABLEServerService temporarily unavailable (maintenance, overload)Retry with backoff
16UNAUTHENTICATEDAuthenticationAPI key is missing or invalidInclude valid key in authorization metadata

Rate-limited gRPC responses include trailing metadata:

Metadata KeyDescription
retry-after-msMilliseconds until the next request will be accepted
x-ratelimit-remainingTokens remaining in the bucket
x-request-idRequest identifier for support reference

For server-streaming and bidirectional RPCs, errors can occur at two points:

  1. Connection time — the initial StreamOpen fails with a status code (e.g., UNAUTHENTICATED, RESOURCE_EXHAUSTED). No messages are delivered.
  2. Mid-stream — the server terminates the stream with a status code after some messages have been delivered (e.g., INTERNAL, UNAVAILABLE). The client should reconnect with backoff.

SSE connections deliver errors as typed events on the open connection. After emitting an error event, the server may either keep the connection open (recoverable errors) or close it (terminal errors).

event: error
data: {"code": "error_code", "message": "Human-readable description", "request_id": "req_abc123", "terminal": true}

The terminal field indicates whether the connection will be closed after this error.

CodeTerminalCategoryDescriptionRecommended Action
auth_failedYesAuthenticationAPI key is missing, invalid, or expiredReconnect with a valid key
auth_expiredYesAuthenticationAPI key was valid at connect time but has since been revokedObtain a new key and reconnect
rate_limitYesRate LimitingConcurrent stream limit exceeded for this tierClose other streams or upgrade tier, then reconnect
tier_restrictedYesAuthorizationRequested event type is not available on the current tierUpgrade tier or remove the restricted type filter
coin_not_foundNoValidationA requested coin identifier is not recognizedThe stream continues for valid coins; fix the identifier
feed_staleNoServerA data source has not produced events for > 60 secondsMonitor; the feed will auto-recover when data resumes
upstream_lagNoServerData delivery is delayed due to upstream backpressureEvents are buffered; expect elevated latency
internalYesServerUnrecoverable server errorReconnect with exponential backoff
maintenanceYesServerPlanned maintenance shutdownReconnect after the maintenance window
reconnectYesServerServer requests client reconnection (e.g., rebalancing)Reconnect immediately

When a terminal error is received:

  1. Close the current connection.
  2. Wait for the duration specified in the retry field (if present in the SSE stream), or use a default of 1 second.
  3. Apply exponential backoff with jitter: wait min(2n+jitter,  30)\min(2^n + \text{jitter},\; 30) seconds on the nn-th consecutive failure.
  4. Reconnect with the Last-Event-ID header set to the last received event ID to resume from the correct position.

WebSocket connections use standard RFC 6455 close codes (1000—1015) and Aleatoric-specific application codes (4000—4099).

CodeNameDescription
1000Normal ClosureClean shutdown initiated by either side
1001Going AwayServer is shutting down or client is navigating away
1002Protocol ErrorWebSocket protocol violation
1003Unsupported DataReceived a data type the endpoint cannot process
1006Abnormal ClosureConnection lost without a close frame (network failure)
1008Policy ViolationMessage violates server policy (e.g., oversized frame)
1009Message Too BigFrame exceeds the 4 MB limit
1011Internal ErrorServer encountered an unexpected error
1013Try Again LaterServer is overloaded; client should reconnect after backoff
CodeNameCategoryDescriptionRecommended Action
4001Invalid API KeyAuthenticationThe provided API key is not validVerify key and reconnect
4002Key ExpiredAuthenticationAPI key has expired since connection was establishedObtain a new key and reconnect
4003Tier Not AuthorizedAuthorizationCurrent tier does not include WebSocket (Disk-Sync) accessUpgrade to Quant tier
4004Coin Not SupportedValidationRequested coin is not available for WebSocket syncCheck supported coins and reconnect
4005Invalid SubscriptionValidationSubscription message is malformedFix the message format and reconnect
4006Subscription LimitRate LimitingMaximum subscription count exceeded for this connectionReduce subscriptions or open additional connections
4007Heartbeat TimeoutServerClient did not respond to ping within 30 secondsEnsure pong handler is implemented; reconnect
4008Duplicate ConnectionRate LimitingAnother connection for this API key already existsClose existing connection first
4009Upstream FailureServerUpstream data source is unreachableReconnect with backoff
4029Rate Limit ExceededRate LimitingMessage send rate exceeds permitted throughputReduce message frequency; reconnect with backoff
4050MaintenanceServerPlanned maintenance shutdownReconnect after the maintenance window

Application close codes (4000-4099) include a UTF-8 reason string in the close frame payload:

Close frame: code=4003, reason="Tier not authorized for Disk-Sync. Upgrade to Quant."

The following table maps equivalent errors across all four protocols for common failure scenarios:

ScenarioHTTPJSON-RPCgRPCSSEWebSocket
Invalid API key401-32001UNAUTHENTICATED (16)auth_failed4001
Tier insufficient403-32002PERMISSION_DENIED (7)tier_restricted4003
Bad parameters400-32602INVALID_ARGUMENT (3)coin_not_found4005
Coin not found404-32003NOT_FOUND (5)coin_not_found4004
Rate limited429-32000RESOURCE_EXHAUSTED (8)rate_limit4029
Server error500-32603INTERNAL (13)internal1011
Maintenance503-32010UNAVAILABLE (14)maintenance4050

Every error response includes a request_id (or equivalent identifier). When contacting support:

  1. Include the request_id from the error response.
  2. Note the protocol, endpoint, and approximate timestamp.
  3. Include the full error payload (redacting your API key).

Error logs are retained for 30 days and can be queried by request_id for Enterprise clients with audit log access.