HomeBook a Demo

Errors

The Partner API error format, every error code, request IDs, and which errors to retry.

Every API error has the same JSON shape:

{
  "error": {
    "code": "not_found",
    "message": "Not found",
    "request_id": "c0ffee00-0000-4000-8000-000000000000"
  }
}
FieldMeaning
error.codeA code for your program. Branch on it, or on the HTTP status.
error.messageA message for people. The wording can change, so do not parse it.
error.request_idThis request's ID. API responses also send it in the X-Request-Id header. It can be null (see responses from outside the API).

Error codes

StatusCodeMeaningRetry?
400invalid_requestA parameter is invalid: a bad date or date range, an unknown or repeated parameter, or a cursor reused with different parameters. The message names the parameter.No. Fix the request.
401unauthorizedThe token is missing, malformed, unknown, revoked, or expired.No. Check the token.
403forbiddenThe token does not have the required scope (the message names it), or your organization cannot use this endpoint.No.
404not_foundThe path or publisher does not exist, or your token cannot see it.No.
405method_not_allowedThe path does not accept this method. The Allow header lists the methods it accepts.No.
429rate_limitedToo many requests. See rate limits.Yes, after Retry-After or with backoff.
500, 502internal_errorSomething went wrong on our side.Yes, with backoff.
503unavailableThe report took more than about 20 seconds to produce, or the request timed out.Yes, with backoff, or ask for less data.

We may add codes. Handle an unknown code by its HTTP status: retry a 5xx with backoff, and do not retry a 4xx other than 429.

Request IDs

Every response from the API has an X-Request-Id header, and error bodies repeat it in error.request_id. Log it with every failure. Quote it when you contact support@getinline.io so we can find the request.

Responses from outside the API

Some responses are sent before the request reaches the API. They have no X-Request-Id header:

  • A rate-limit 429 from our firewall has request_id: null and Retry-After: 300.
  • Errors from our API gateway, such as a 429 when the whole API is busy (Retry-After: 1) or a 502, have a request_id in the body. Quote it to support.

Always check the HTTP status first.

Retries

  • Retry 429 and every 5xx with exponential backoff and jitter: for example, after 1, 2, 4, then 8 seconds, up to a limit. If a 429 has a Retry-After header, wait that many seconds instead.
  • Do not retry any other 4xx without changing the request.
  • If a report keeps returning 503, ask for fewer days or one publisher_id. See revenue report errors.