PulseEmetrics

Errors

Failures return a non-2xx status and a consistent JSON body.

Error format

{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits. This request costs 5."
  },
  "meta": { "request_id": "req_…", "credits_charged": 0 }
}

Branch on error.code; the message is for humans and may change.

Error codes

StatusCodeMeaningCharged?
400invalid_parameterA parameter is missing, unknown or invalid. The message says which.No
401invalid_api_keyThe key is missing, wrong or revoked.No
402insufficient_creditsYour balance is lower than the price of this request.No
404not_foundThe endpoint or the requested profile or item does not exist.No
429rate_limitedToo many requests. Wait for Retry-After seconds.No
502upstream_errorThe data source failed. Retry later.No
503unavailableTemporarily unavailable or the source is not configured.No

Retrying safely

  • Retry 429, 502 and 503 with exponential backoff.
  • Do not retry 400, 401, 402 or 404 without changing something.
  • Requests are read-only, so retrying is always safe, and failed attempts cost nothing.