Skip to main content
Return standard HTTP status codes. HunterAI’s behaviour for each is fixed and listed below.

Error body shape

On any error, return a JSON body with an error string. HunterAI reads it into the failure detail it records for the sync:
The body is optional — HunterAI falls back to the status code if it is absent or not JSON — but a clear message makes failures easy to diagnose. Only the first 300 characters are kept.

Status codes

“The entity fails” means that one entity (e.g. /leads) is marked failed for the run; entities that already committed stay committed. See Partial success.

401 Unauthorized

  • No retry — HunterAI stops the entity the instant it sees 401.
  • Nothing from an unauthenticated call is ingested.
  • Every entity in the run hits the same 401, so the whole sync ends failed.
What the business owner sees: the connection’s sync is marked failed with an authentication error. The fix is to update the token on the connection (see Authentication → Rotating) and re-run the sync.

404 Not Found

404 is how you declare an optional endpoint unimplemented.
Do not return 404 for an implemented endpoint that simply has no data — return 200 with { "data": [], "has_more": false } instead. A 404 on a required endpoint is read as “not implemented” and fails the entity.

429 and 5xx errors

Both are treated as transient and retried up to 5 times before the entity fails.
  • 429 — HunterAI waits for the larger of your Retry-After header (seconds, floored to 1s) and an exponential backoff (1, 2, 4, 8, 16 s).
  • 5xx — HunterAI backs off exponentially (1, 2, 4, 8, 16 s) and retries.
If the endpoint is still failing after the retries, that entity is marked failed and the rest of the sync continues.

Other 4xx — hard failure

400, 403, 422, and any other 4xx that is not 401, 404, or 429 fail the entity immediately with no retry. Reserve these for genuine client errors; do not use them for throttling (use 429) or transient issues (use 5xx).