Skip to main content
When a request fails, ErynoaGroup returns a structured JSON error response alongside an appropriate HTTP status code. Use the code field to programmatically identify and handle specific error conditions.

Error response format

{
  "error": {
    "code": "validation_error",
    "message": "The 'name' field is required.",
    "status": 422,
    "request_id": "req_01HX9P3NXVQMJRFT8K2BWYC7E",
    "details": [
      {
        "field": "name",
        "message": "This field is required."
      }
    ]
  }
}
Always log the request_id — include it when contacting support to help diagnose issues quickly.

Error codes

Authentication errors (401, 403)

CodeStatusDescriptionAction
missing_api_key401No Authorization header presentAdd Authorization: Bearer YOUR_KEY header
invalid_api_key401Key does not exist or is malformedCheck the key in your dashboard
api_key_revoked401Key was revokedGenerate a new key
api_key_expired401Key has passed its expiry dateGenerate a new key
insufficient_scope403Key lacks required permissionsCreate a key with the appropriate scope
ip_not_allowed403Request IP not on the key’s allowlistUpdate the IP allowlist or use an allowed IP

Validation errors (400, 422)

CodeStatusDescriptionAction
invalid_request400Request is malformed or unparseableCheck request body format and Content-Type
validation_error422One or more fields failed validationCheck the details array for field-specific messages
invalid_parameter400A query parameter has an invalid valueReview the parameter documentation
missing_required_field422A required field is absentAdd the missing field to the request body

Resource errors (404, 409)

CodeStatusDescriptionAction
resource_not_found404The requested resource does not existVerify the resource ID
resource_already_exists409A resource with this identifier already existsUse a different identifier or retrieve the existing resource
resource_conflict409Operation conflicts with current resource stateCheck the resource’s current status before retrying

Rate limit errors (429)

CodeStatusDescriptionAction
rate_limit_exceeded429Too many requests in the current windowWait for Retry-After seconds, then retry with backoff

Server errors (500, 502, 503)

CodeStatusDescriptionAction
internal_error500Unexpected server errorRetry after a short delay; contact support if persistent
service_unavailable503API is temporarily unavailableCheck the status page; retry with exponential backoff

Handling errors in code

import requests
import time

def make_api_request(url, headers, payload=None, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = requests.post(url, json=payload, headers=headers, timeout=30)

            if response.status_code == 429:
                retry_after = int(response.headers.get("Retry-After", 2 ** attempt))
                time.sleep(retry_after)
                continue

            if response.status_code >= 500:
                time.sleep(2 ** attempt)
                continue

            response.raise_for_status()
            return response.json()

        except requests.exceptions.Timeout:
            if attempt < max_retries - 1:
                time.sleep(2 ** attempt)
            else:
                raise

    raise Exception(f"Request failed after {max_retries} attempts")