Skip to main content

Production clients should classify failures into operator actions.

Callaro non-2xx responses include error_code. Use both status and error_code to decide whether to retry, reconfigure, or escalate.

Operator response matrix

StatusExample error_codeTypical endpoint familiesOperator action
401UNAUTHORIZED, JWT_REQUIREDAny authenticated endpointValidate token/key, environment, and auth model
403FORBIDDENScoped key endpoints (campaigns, contacts, billing)Grant missing scope or use correct key type
404SESSION_NOT_FOUND, resource-specific not foundVoice sessions, contacts, campaign detailVerify ID and tenant context
422VALIDATION_ERROR, domain-specific codesCreate/update/launch operationsFix payload/business preconditions and retry
429Rate limit codesHigh-volume list and mutation workloadsBackoff and throttle worker concurrency
5xxINTERNAL_ERRORAnyRetry with capped backoff; escalate with request_id if persistent

Retry policy guidance

  • Retry: network failures, 429, and selected transient 5xx errors.
  • Do not retry blindly: 401, 403, most 404, and structural 422 errors.
  • Record request_id for all failed requests.
curl "https://api.callaro.ai/api/v1/voice_sessions/999999" \
  -H "X-Api-Key: $CALLARO_API_KEY"

Endpoint-family examples

  • Campaign launch: 422 usually indicates missing contacts, schedule issues, or invalid campaign configuration.
  • Contacts import/export: 422 often signals invalid CSV mapping or payload schema.
  • Phone number purchase: 422 may indicate region/provider constraints.
  • Billing allocation: 403/422 should be reviewed for partner scope and payload correctness.
Never classify all 4xx responses as permanent and all 5xx responses as safe retries. Use endpoint context and error code semantics to avoid duplicate side effects.