Documentation

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\"."
  }
}
CodeStatusMeaning
unauthorized401No bearer token, or not a valid one.
validation400A query parameter, path parameter or the body is malformed. detail names it.
not_found404No such template or document, or the account cannot see it. The two cases are deliberately indistinguishable.
template_not_saved409The template has no saved version yet; only saved templates can generate.
subscription_required402The workspace has no active plan. An owner or admin can choose one on the billing page; nothing is lost.
document_limit_reached402The 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_placeholder422A key of values is not a placeholder key of this template. The message lists the valid keys.
unknown_group_field422A key inside an instance object is not a field key of that group. The message lists the fields.
invalid_option422A select placeholder was sent a value that is not one of its options.
invalid_number422A number placeholder was sent something that is not a number.
invalid_values422A placeholder was sent an array, or a group was sent a string.
idempotency_in_flight409The same request is still being processed. Retry in a moment.
payload_too_large413The request body is over 1 MB.
method_not_allowed405The method is not supported on this path. The Allow header lists what is.
pdf_render_failed500The document's PDF could not be rendered. Asking again retries it.
internal500Something went wrong on our side. Retry; if it persists, write to us.