Request reference
Fields, response and status codes of a render request.
A render request is a POST with a JSON body, both with the npm client and with
fetch. The applicationId is part of the URL.
Request
| Field | Type | Required | Description |
|---|---|---|---|
applicationId | string | Yes | ID of the application (part of the path). |
payloads | array | Yes | One entry per document to render. |
payloads[].id | string | Yes | Your own ID for the document, echoed in the reply. |
payloads[].templateId | string | Yes | ID of the template to render. |
payloads[].data | object | Yes | Template variables, as a plain JSON object. |
data is an object, not a JSON string. Its keys are the template variables;
values may be strings, numbers, booleans, arrays or nested objects. See
Template syntax.
Response
201 Created with one entry per rendered document:
| Field | Type | Description |
|---|---|---|
generatedDocuments | array | One entry per document of the request. |
generatedDocuments[].id | string | The id you sent for that document. |
generatedDocuments[].fileId | string | ID the service gave the rendered file. |
generatedDocuments[].templateId | string | The template used for that document. |
generatedDocuments[].url | string | Endpoint the PDF is served from. |
url is an endpoint of this service, not a public link. Requesting it needs
your API key, see Download a PDF.
Status codes
| Status | Meaning |
|---|---|
201 | Every document of the request was rendered. |
400 | Malformed applicationId, malformed request body or the payloads array is empty. |
401 | No API key sent. |
404 | Template is not found. |
403 | Unknown or deleted API key. |
500 | Rendering failed, e.g. the template has invalid Liquid syntax. |
A batch is all-or-nothing: if one document fails, the request fails and no URLs are returned, not even for the documents that rendered fine.