Envelope
Every error response is JSON with anerror object:
code— stable, machine-readable. Branch on this.message— human-readable; do not parse.issues— present on validation errors; a Zodflatten()withfieldErrors/formErrors.
Codes
| Status | code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_json | Body is not valid JSON. | No |
| 400 | invalid_request | Body failed schema validation. | No |
| 400 | invalid_input_data | data did not match the manifest. Inspect issues.fieldErrors. | No |
| 401 | unauthorized | Missing, invalid, revoked, or wrong-environment key. | No |
| 403 | forbidden | Key’s project was not found. | No |
| 404 | template_not_found | No such template in this key’s project. | No |
| 404 | version_not_found | Pinned versionNumber does not exist. | No |
| 404 | not_found | Render (or other resource) not found in this project. | No |
| 409 | no_published_version | Template has no published version. | After publishing |
| 409 | not_ready | Share requested before the render succeeded. | After completion |
| 503 | queue_unavailable | Render queue temporarily unreachable. | Yes — backoff |
| 500 | internal | Unexpected server error. | Yes — backoff |
Retry semantics
- Never retry 4xx except where noted — the request will fail again unchanged. Fix the input.
- Retry 503 / 5xx with exponential backoff (e.g. 1s → 2s → 4s → 8s → 16s, cap ~30s, ~5 attempts).
- For render submission, pair retries with an
Idempotency-Keyso a retried submit never produces a duplicate document.