API REFERENCE
Errors
Failed requests return a JSON error body instead of a PDF. Here's every code.
Error shape
Errors are JSON with a stable machine-readable error string and a human-readable message:
{
"error": "template_not_found",
"message": "No stored template with that id exists for your account."
}Branch on the error field — the message wording may change, but the codes below are stable.
Status codes
| Status | Error | Meaning |
|---|---|---|
| 400 | bad_request | Body is not JSON, or neither html nor template was provided. |
| 401 | unauthorized | Missing or invalid API key. |
| 402 | payment_required | Out of render credits. Upgrade your plan to continue. |
| 404 | template_not_found | A stored template id (tpl_…) was passed that your account does not own. |
| 429 | rate_limited | Too many requests — slow down and retry. |
Handling errors
- 401 — check the key and the
Authorization: Bearer …header. See Authentication. - 402 — you're out of credits; upgrade in Billing. See Rate limits & credits.
- 404 — the
tpl_…id isn't one your account owns. See Templates. - 429 — back off and retry with exponential backoff.