Cross-cutting

Errors

Every non-2xx response is a JSON envelope: { error: { code, message, request_id, …extras } }. Pin to the code, not the message.

Envelope

json{
  "error": {
    "code": "forbidden_entitlement_missing",
    "message": "Your organization is not entitled to DAVA Connect. …",
    "request_id": "req_a1b2c3d4",
    "product": "connect"
  }
}

The code is stable — never localized, never reworded. The message may change between releases. Always branch on code in your client.

Common codes

HTTPCodeMeaning
401auth_requiredNo session and no API key on a route that requires one.
401invalid_api_keyBearer token didn't verify, or the key was revoked.
403csrf_mismatchCookie-auth mutation without a matching X-CSRF-Token header.
403forbidden_entitlement_missingOrg isn't entitled to the product. Check /admin/orgs/<id>.
403forbidden_entitlement_disabledEntitlement exists but is paused. AVA staff toggles it back.
403license_missing_<product>Self-host license doesn't cover this product.
403forbidden_staff_onlyCustomer account hit a staff-only route.
404org_not_found / job_not_found / file_not_foundThe named resource doesn't exist or isn't visible to this org.
409bootstrap_already_doneFirst-run wizard hit on a system that already has users.
410file_data_missingFile row exists but its bytes have been retention-swept.
413file_too_largeUploaded file exceeds the per-product cap.
415unsupported_formatConnect/Norm/Dedup currently accept CSV/TSV; other formats land later.
422validation_errorPydantic body shape mismatch. Check the `fields` array on the response for specifics.
429sandbox_budget_exhaustedPer-day sandbox-second cap hit. Comes back with a Retry-After header.
502agent_llm_errorUpstream LLM call failed. The user message stays persisted; agent retry creates a new turn.
503storage_unconfigured / agent_llm_unconfiguredOperator misconfiguration — should never happen on managed cloud; check env on self-host.

Retry policy

4xx codes are caller errors — fix and retry, never blind-loop. 429 carries a Retry-After header with the wait-seconds. 5xx is server-side; SDKs back off exponentially with jitter (5 attempts max, ~30s total). 502 specifically on Agent is the LLM provider hiccupping — the user's message is already persisted, so retrying just creates a new turn.