Getting started
Errors
Every error, whatever the status, has one shape. code is stable and safe to branch on; message says what went wrong and, where it helps, what to send instead; detail names the parameter, header or value the error is about when there is one.
JSON
{
"error": {
"code": "unknown_placeholder",
"message": "No placeholder is keyed \"client\". Keys of `values` must be placeholder KEYS (the template’s placeholders[].key, e.g. \"client_name\"), not the values currently filled in and not names read out of the text. Retry with keys taken from exactly this list: \"client_name\", \"payment_terms\", \"due_date\", \"invoice_number\", \"issue_date\", \"line_items\"."
}
}| Code | Status | Meaning |
|---|---|---|
unauthorized | 401 | No bearer token, or not a valid one. |
validation | 400 | A query parameter, path parameter or the body is malformed. detail names it. |
not_found | 404 | No such template or document, or the account cannot see it. The two cases are deliberately indistinguishable. |
template_not_saved | 409 | The template has no saved version yet; only saved templates can generate. |
subscription_required | 402 | The workspace has no active plan. An owner or admin can choose one on the billing page; nothing is lost. |
document_limit_reached | 402 | The workspace has generated all the documents its plan, or the free trial, allows this month. Generating resumes on the first of next month (UTC), or at once when an owner or admin moves to a bigger plan on the billing page. Documents already generated are untouched. |
unknown_placeholder | 422 | A key of values is not a placeholder key of this template. The message lists the valid keys. |
unknown_group_field | 422 | A key inside an instance object is not a field key of that group. The message lists the fields. |
invalid_option | 422 | A select placeholder was sent a value that is not one of its options. |
invalid_number | 422 | A number placeholder was sent something that is not a number. |
invalid_values | 422 | A placeholder was sent an array, or a group was sent a string. |
idempotency_in_flight | 409 | The same request is still being processed. Retry in a moment. |
payload_too_large | 413 | The request body is over 1 MB. |
method_not_allowed | 405 | The method is not supported on this path. The Allow header lists what is. |
pdf_render_failed | 500 | The document's PDF could not be rendered. Asking again retries it. |
internal | 500 | Something went wrong on our side. Retry; if it persists, write to us. |