Getting started
Errors
Every error body has the same shape. Branch on error, never on message: the message is for people and its wording can change.
{ "error": "VALIDATION_ERROR",
"message": "The request is invalid; see violations.",
"violations": [
"bets[0].odds: American odds: at most -100 or at least +100 (magnitude ≤ 100000)",
"bets[0].probability: required, between 0.000001 and 0.999999",
"bankroll: must be greater than 0 and at most 100000000"
],
"requestId": "req_d33eeffe7b8d4856807a44c9c8bc4d38" }violations: every problem in the request at once, each asfield: problem(validation errors), or the reasons a slate could not be sized.requiredTier: onUPGRADE_REQUIRED, the plan needed.retryAfterSeconds: on both 429s.resetsAt: onDAILY_LIMIT_EXCEEDED.requestId: on every error, and in theX-Request-Idheader of every response. Quote it when you contact support@kellyiq.com.
Codes
| Status | error | What to do |
|---|---|---|
| 400 | VALIDATION_ERROR | Fix every field listed in violations. |
| 400 | INVALID_JSON | The body is not valid JSON, or a field has the wrong type. |
| 400 | INVALID_REQUEST | The request could not be processed as sent. |
| 401 | INVALID_API_KEY | Missing, wrong or revoked key. |
| 403 | UPGRADE_REQUIRED | The slate or input needs a higher plan; requiredTier says which. |
| 403 | FORBIDDEN | Refused for another reason. Quote the requestId to support. |
| 403 | API_NOT_ENABLED | The API is switched off. Nothing is wrong with your account; retry later. |
| 404 | NOT_FOUND | No such endpoint. |
| 405 | METHOD_NOT_ALLOWED | Wrong HTTP method for this endpoint. |
| 415 | UNSUPPORTED_MEDIA_TYPE | Send Content-Type: application/json. |
| 422 | SLATE_NOT_OPTIMIZABLE | Nothing in the slate could be sized; reasons in violations. |
| 429 | DAILY_LIMIT_EXCEEDED | Done for today. Retry after resetsAt, never in a loop. |
| 429 | BURST_LIMIT_EXCEEDED | Too fast or overlapping. Wait retryAfterSeconds. |
| 500 | INTERNAL_ERROR | Our fault. Quote the requestId to support. |
| 503 | SERVICE_BUSY | Server capacity or a temporary outage. Retry after the Retry-After seconds. |
New codes may be added. Handle one you do not recognize by its HTTP status.