Error categories
Octogen API errors fall into two categories:- HTTP errors (4xx/5xx) — The server returned a non-2xx response. The SDK raises a typed exception with a
status_code,detail, and the rawresponseattached. - Network errors — The request never reached the server (DNS failure, timeout, connection reset). The SDK raises
OctogenConnectionError.
If you are using the Developer MCP server instead of the REST API, tool-level errors are returned as HTTP 200 responses with an
error field in the payload rather than as HTTP error codes. This guide covers the REST API only.HTTP error reference
400 — Bad request
400 — Bad request
SDK exception:
OctogenAPIError with status_code (Python) / statusCode (TypeScript) equal to 400The request was syntactically valid JSON but could not be accepted for the requested operation. For POST /products/refresh, this means no target could be accepted; inspect the response body’s rejected array for per-target codes and messages.Recovery: Fix the rejected targets and retry only those targets.401 — Authentication error
401 — Authentication error
SDK exception:
OctogenAuthenticationErrorThe API key is missing, malformed, or has been revoked. Common causes:OCTO_API_KEYenvironment variable is not set- The key string was truncated or contains extra whitespace
- The key was deactivated in Octogen Platform
403 — Forbidden
403 — Forbidden
SDK exception:
OctogenForbiddenErrorThe API key is valid, but your organization is not allowed to perform this operation. Common causes:- Your organization does not have Developer access
- The API key belongs to the wrong organization
- The key’s org type does not have permission for the endpoint
404 — Not found
404 — Not found
SDK exception:
OctogenNotFoundErrorThe requested catalog or product is not visible to your API key. Common detail values:"catalog_not_found"— The catalog key you passed does not identify an active crawled catalog available to this organization."product_not_found"— The Product Lookup sources selected byresolutionModedid not return a useful product. Forindex_only, no granted active catalog matched the URL.
catalog field for policy-wide search. For Product Lookup, confirm the URL is a product page and choose the appropriate resolution mode.422 — Validation error
422 — Validation error
SDK exception: Each entry has:
OctogenValidationErrorThe request body failed schema validation. Product Lookup can also return detail: "invalid_product_url" for a malformed or unsupported URL, or detail: "unsafe_url" when the target fails outbound safety checks.For field validation, the response body contains a detail array where each entry identifies the invalid field:loc— path to the invalid field (e.g.["body", "limit"])msg— human-readable error messagetype— machine-readable error type
429 — Rate limited
429 — Rate limited
SDK exception:
OctogenAPIError with status_code (Python) / statusCode (TypeScript) equal to 429Your request exceeded a service-wide budget. The shared API budget returns detail: "rate_limit_exceeded"; Product Lookup can return detail: "product_lookup_rate_limited" when its on-demand capacity is exhausted. Both responses include a Retry-After header with the number of seconds to wait.Recovery: Unlike the other 4xx errors, 429 is transient. Wait the Retry-After interval, then retry with exponential backoff. See Rate Limits for the headers, the MCP equivalent, and bulk-job guidance.502 — Upstream failure
502 — Upstream failure
SDK exception:
OctogenAPIError with status_code (Python) / statusCode (TypeScript) equal to 502Product Lookup returns detail: "product_lookup_upstream_failed" when the merchant page fails upstream.Recovery: Retry with exponential backoff. If the error persists, verify the merchant URL in a browser before contacting Octogen support.504 — Lookup timed out
504 — Lookup timed out
SDK exception:
OctogenAPIError with status_code (Python) / statusCode (TypeScript) equal to 504Product Lookup returns detail: "product_lookup_timed_out" when its bounded synchronous deadline expires.Recovery: Retry with exponential backoff. Repeated timeouts can indicate that the merchant page is slow or unavailable.SDK exception hierarchy
All SDK exceptions inherit fromOctogenError. The full hierarchy:
OctogenAPIError and its subclasses expose:
.status_code(Python) /.statusCode(TypeScript) — the HTTP status code.detail— the parsed error body from thedetailfield, or the raw response text.response— the underlying HTTP response object
Handling errors in code
Retry guidance
For transient errors and
5xx responses, use an exponential backoff strategy with jitter. Start with a 1-second delay, double on each retry, and cap at 30 seconds. After three to five failed attempts, surface the error to the caller rather than retrying indefinitely.