Skip to main content
Peel returns errors in two shapes:
  • HTTP errors come from the Peel host itself, such as a wrong API key, a bad request shape, an API not found, or an endpoint that is not ready.
  • Runtime execution errors come from a :call request where the compiled endpoint ran but failed to produce a successful result. These return the same normalized runtime envelope as successful calls. The outer HTTP status usually mirrors the envelope’s status_code, so runtime errors can be 403, 422, 429, 502, 503, 504, or another target/upstream status rather than always 200.
  • Build failures appear on GET /v1/apis/{api_id} when an API has status: "failed" and on GET /v1/apis/{api_id}/health when health returns status: "build_failed". These use failure_reason_code plus a structured failure.artifact, not the runtime response envelope.
For endpoint calls, check both layers: the HTTP status first, then status, status_code, and error_code if the response body is a runtime envelope. Host/setup errors may only include error or code; runtime errors include the normalized envelope. For failed builds, inspect failure_reason_code and failure.artifact on the API detail or failed-health response.

HTTP errors

Runtime error codes

When :call returns a runtime envelope with status: "error" or status: "timeout", the error_code field tells you what happened inside the compiled runtime. These are domain-specific errors: Peel reached the compiled endpoint execution path, but the compiled contract failed to produce data. Each runtime error also sets the outer HTTP status to the value in the table above, so you can branch on either layer.

Build failures

Errors during build are visible in GET /v1/apis/{api_id} when status is failed. The same failure object is also present in GET /v1/apis/{api_id}/health when that route returns status: "build_failed":
Use failure_reason_code for compact branching, failure.non_publishable_reason for the stable reason no API was published when one is available, and failure.artifact for support, billing, and retry decisions. failure.artifact.failure_class normalizes many lower-level codes into stable classes such as captcha_or_botwall, auth_required, unsupported_action, no_matching_data, compile_policy_violation, runtime_verification_failed, build_timeout, and internal_error. failure.artifact.billing_disposition tells you whether the build is not billable, needs refund review, or needs operator review. Action-flow gates keep publication closed until Peel has compiled a deterministic, policy-checked request sequence. These failures use failure.non_publishable_reason: "unsupported_action" and failure.artifact.failure_class: "unsupported_action". When the build reaches the custom artifact publish gate, Peel has already compiled a deterministic runtime artifact and is deciding whether it is safe to publish. These failures keep failure_reason_code: "compile_unpublishable_output" and usually normalize to failure.non_publishable_reason: "artifact_publishability_failed". Inspect failure.artifact.technical_reason and failure.artifact.support_debug_id for the precise operator diagnostic:

Response envelope

All :call responses, successful or failed, share the same top-level envelope:
On error:
status_code inside the envelope mirrors the outer HTTP status so clients that only surface the body still have the code. For deterministic replay endpoints, upstream HTTP failures keep their target status and include structured upstream details in data instead of projecting through the endpoint output schema:
On failures where the transport succeeded but the parser could not extract structured data, the envelope also includes a raw_output field: a truncated preview of the upstream response body. Use it to debug extraction_failed and transport_error outcomes:
raw_output is always clipped and is not a substitute for a proper re-parse. When it appears consistently on a previously healthy endpoint, rebuild the API.

When an error means rebuild

Three signals usually point to rebuild as the right action:
  1. GET /v1/apis/{api_id}/health returns recommended_action: "rebuild".
  2. error_code is extraction_failed or endpoint_not_found on a previously healthy endpoint.
  3. Multiple endpoints on the same API start returning transport_error in a short window.
See API updates for the full decision tree.