Skip to main content

Error Handling

How Gonos reports errors and how to handle them in your integration.

Error response format

All error responses follow a consistent JSON structure:

{
  "detail": "Human-readable error message",
  "error_code": "MACHINE_READABLE_CODE",
  "correlation_id": "abc123-def456",
  "errors": [
    {
      "field": "email",
      "message": "Not a valid email address"
    }
  ]
}
FieldDescription
detailHuman-readable description of the error
error_codeMachine-readable error code for programmatic handling
correlation_idUnique ID for the request — include this when contacting support
errorsArray of field-level validation errors (only on 422 responses)

HTTP status codes

CodeMeaningWhen
400Bad RequestMalformed JSON, missing required fields
401UnauthorizedMissing or invalid API key / JWT token
403ForbiddenValid credentials but insufficient scope or permissions
404Not FoundResource does not exist or does not belong to your organization
409ConflictDuplicate resource (e.g., idempotency key reuse)
422Validation ErrorRequest understood but contains invalid data
429Too Many RequestsRate limit exceeded — check Retry-After header
500Internal ErrorUnexpected server error — safe to retry

Common error codes

Error CodeDescription
CONSENT_REQUIREDBackground check requires consumer consent first
CONSENT_EXPIREDConsent has expired and must be recaptured
CANDIDATE_NOT_FOUNDThe specified candidate ID does not exist
CHECK_NOT_FOUNDThe specified check ID does not exist
INVALID_PACKAGEThe check package name is not recognized
INVALID_PURPOSEThe permissible purpose is not a valid FCRA purpose
QUOTA_EXCEEDEDMonthly check quota has been reached
DUPLICATE_CHECKA check with this idempotency key already exists
FCRA_MANDATORY_TYPECannot unsubscribe from FCRA-mandatory notification types
CERTIFICATION_REQUIREDPurpose certification must be acknowledged

Retry strategies

Safe to retry

  • 429 responses — wait for the Retry-After header duration
  • 500 responses — use exponential backoff (1s, 2s, 4s, 8s, 16s)
  • Network timeouts or connection errors

Do not retry

  • 400, 401, 403, 404 — fix the request first
  • 409 — the resource already exists, fetch it instead
  • 422 — fix the validation errors in your payload

Example: exponential backoff

import time
import httpx

def request_with_retry(method, url, **kwargs):
    max_retries = 5
    for attempt in range(max_retries):
        response = httpx.request(method, url, **kwargs)
        if response.status_code == 429:
            wait = int(response.headers.get("Retry-After", 60))
            time.sleep(wait)
            continue
        if response.status_code >= 500:
            time.sleep(2 ** attempt)
            continue
        return response
    raise Exception("Max retries exceeded")

Getting help

When contacting support about an error, always include the correlation_id from the error response. This allows us to trace the exact request through our systems.