Docs menu
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 as field: problem (validation errors), or the reasons a slate could not be sized.
  • requiredTier: on UPGRADE_REQUIRED, the plan needed.
  • retryAfterSeconds: on both 429s. resetsAt: on DAILY_LIMIT_EXCEEDED.
  • requestId: on every error, and in the X-Request-Id header of every response. Quote it when you contact support@kellyiq.com.

Codes

StatuserrorWhat to do
400VALIDATION_ERRORFix every field listed in violations.
400INVALID_JSONThe body is not valid JSON, or a field has the wrong type.
400INVALID_REQUESTThe request could not be processed as sent.
401INVALID_API_KEYMissing, wrong or revoked key.
403UPGRADE_REQUIREDThe slate or input needs a higher plan; requiredTier says which.
403FORBIDDENRefused for another reason. Quote the requestId to support.
403API_NOT_ENABLEDThe API is switched off. Nothing is wrong with your account; retry later.
404NOT_FOUNDNo such endpoint.
405METHOD_NOT_ALLOWEDWrong HTTP method for this endpoint.
415UNSUPPORTED_MEDIA_TYPESend Content-Type: application/json.
422SLATE_NOT_OPTIMIZABLENothing in the slate could be sized; reasons in violations.
429DAILY_LIMIT_EXCEEDEDDone for today. Retry after resetsAt, never in a loop.
429BURST_LIMIT_EXCEEDEDToo fast or overlapping. Wait retryAfterSeconds.
500INTERNAL_ERROROur fault. Quote the requestId to support.
503SERVICE_BUSYServer 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.