Errors

Errors

Every non-2xx response uses the same JSON envelope, so you can write one error handler for the whole API.

Error envelope

Every error response has this shape:

json
{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "You've used all the queries included in your plan for this period.",
    "request_id": "req_7516a7ab-9800-4596-ae1a-4eee0b47f666",
    "documentation_url": "https://docs.lumen.com/errors#quota_exceeded",
    "details": { "field": "country_code" }
  }
}
FieldDescription
codeA stable, machine-readable string — safe to switch on in your code.
messageA human-readable explanation, safe to show directly to your own users.
request_idInclude this when contacting support — it lets us find the exact request.
documentation_urlDeep link to this page for that specific code.
detailsOptional extra context (e.g. which field was invalid). Not always present.
Tip: Match on error.code, never on error.message — message text can change; codes don't.

Retrying safely

A response is worth retrying (with backoff) when its status is 429 or 5xx, or its code is one of SERVICE_UNAVAILABLE, TIMEOUT. On 429, honor the Retry-After header (seconds) if present rather than guessing a backoff. Everything else — validation errors, auth failures, not-found — will fail again identically on retry; fix the request instead.

400 — Bad request

CodeMeaning
INVALID_REQUESTThe request body or query string is malformed.
MISSING_REQUIRED_FIELDA required field was omitted.
INVALID_FIELD_VALUEA field was present but its value is invalid.
INVALID_BUSINESS_IDENTIFIERThe business name identifier is invalid.
INVALID_FIELD_PATHThe dot-path given for a correction doesn’t match any known field.
BATCH_TOO_LARGEA batch request exceeded the maximum allowed items.
BATCH_EMPTYA batch request had zero items.
AMBIGUOUS_BUSINESSThe name/location given matches more than one business — add a locality hint.

401 — Unauthorized

CodeMeaning
MISSING_AUTHNo Authorization header was sent.
INVALID_API_KEYThe key doesn’t match any active key on file.
EXPIRED_API_KEYThe key existed but its expiry date has passed.
MALFORMED_AUTHThe Authorization header isn’t a recognizable Bearer token.

403 — Forbidden

CodeMeaning
INSUFFICIENT_SCOPEThe key is valid but lacks the scope this endpoint requires.
ACCOUNT_SUSPENDEDThe account has been suspended — see message for the reason.
IP_NOT_ALLOWEDThe account has an IP allowlist configured and the caller isn’t on it.
FEATURE_NOT_AVAILABLEThe current plan doesn’t include this feature — see the suggested upgrade in the response.
RESTRICTED_BUSINESSThe requested business falls under a legal or policy restriction.

404 — Not found

CodeMeaning
BUSINESS_NOT_FOUNDNo business could be resolved for the given identifier.
PROFILE_NOT_FOUNDNo profile exists with the given ID.
BATCH_NOT_FOUNDNo batch job exists with the given ID.
INVOICE_NOT_FOUNDNo invoice exists with the given ID, or it doesn’t belong to this account.
NO_DATA_AVAILABLEThe business was found but Lumen Sieve has no data for the requested field(s).

409 — Conflict

CodeMeaning
DUPLICATE_REQUESTAn identical request (same Idempotency-Key) is already being processed.

429 — Too many requests

CodeMeaning
RATE_LIMIT_EXCEEDEDToo many requests in a short window — see your plan’s requests-per-minute in Rate limits & plans.
QUOTA_EXCEEDEDThe account has used its full quota for the current billing period (or lifetime, on the Free plan).
CONCURRENT_LIMIT_EXCEEDEDToo many requests in flight at once for this account’s plan.

5xx — Server-side

CodeStatusMeaning
INTERNAL_ERROR500An unexpected error on Lumen Sieve’s side. Our team is notified automatically.
EXTRACTION_FAILED502A downstream data source failed in a way that blocked extraction.
TIMEOUT504The request took longer than the service’s deadline.
SERVICE_UNAVAILABLE503A downstream service (or a third-party provider like Paddle) is temporarily unreachable.
PARTIAL_FAILURE206The request partially succeeded — check the response body for which parts failed.
NOT_IMPLEMENTED501The endpoint exists but this specific capability isn’t enabled yet.