About this endpoint
What it does
Generates a letter document from JSON input. You provide the letter content plus optional page and output settings, and the endpoint returns rendering metadata and, for document outputs, the generated payload details.
Request Body
| Parameter | Type | Description |
|---|---|---|
| data | Object | Letter content. Includes sender, recipient, date, and paragraphs. |
| data.date | String | Date string. Max length 32. |
| data.sender | Object | Sender details. Includes name and optional contact/address fields. |
| data.sender.name | String | Sender name. Max length 200. |
| data.sender.email | String | Sender email. Max length 200. Default: null. |
| data.sender.phone | String | Sender phone. Max length 64. Default: null. |
| data.sender.tax_id | String | VAT / tax registration number. Max length 64. Default: null. |
| data.sender.address | String Array | Address lines. Max items: 8. |
| data.closing | String | Letter closing. Default: Kind regards,. Max length 200. |
| data.subject | String | Letter subject. Max length 200. Default: null. |
| data.recipient | Object | Recipient details. Includes name and optional contact/address fields. |
| data.recipient.name | String | Recipient name. Max length 200. |
| data.recipient.email | String | Recipient email. Max length 200. Default: null. |
| data.recipient.phone | String | Recipient phone. Max length 64. Default: null. |
| data.recipient.tax_id | String | VAT / tax registration number. Max length 64. Default: null. |
| data.recipient.address | String Array | Address lines. Max items: 8. |
| data.reference | String | Reference. Max length 64. Default: null. |
| data.signature | String | Signature name or text. Max length 200. Default: null. |
| data.paragraphs | String Array | Body paragraphs. Min items: 1, max items: 50. |
| data.salutation | String | Letter salutation. Default: Dear Sir or Madam,. Max length 200. |
| page | Object | Paper size, margin, and orientation for PDF output. |
| page.size | ENUM | Allowed values: A4, Letter, Legal, A3, A5. Default: A4. |
| page.margin_mm | Number | Uniform page margin in millimetres. Minimum 0, maximum 50. Default: 18. |
| page.orientation | ENUM | Allowed values: portrait, landscape. Default: portrait. |
| format | ENUM | Allowed values: json, html, pdf, docx. Default: json. pdf, html or docx return the bytes; json returns a PDF data URI plus metadata. |
| download | Boolean | Send Content-Disposition: attachment so browsers save the file. Default: false. |
Response
Returns a JSON object with bytes (integer), cache (string), pages (integer, nullable), engine (string), format (string), data_uri (string), warnings (array of strings), queued_ms (integer), render_ms (integer), media_type (string), and engine_version (string) fields. The format field is limited to docx, pdf, or html; pages is null for DOCX/HTML.
Replace the Response table with this, removing the Status Code column:
| Attribute | Type | Description |
|---|---|---|
| bytes | Integer | Number of bytes in the generated output. |
| cache | ENUM | Allowed values: hit, miss. |
| pages | Integer | PDF page count; null for DOCX/HTML. |
| engine | String | Rendering engine name. |
| format | ENUM | Allowed values: docx, pdf, html. |
| data_uri | String | Data URI in the form data:<media_type>;base64,…. |
| warnings | String Array | Warnings emitted during rendering. |
| queued_ms | Integer | Time spent queued, in milliseconds. |
| render_ms | Integer | Time spent rendering, in milliseconds. |
| media_type | String | MIME type of the generated output. |
| engine_version | String | Rendering engine version. |
Notes
When format is json, the response includes a PDF data URI plus metadata instead of raw bytes. The pages field can be null when the generated output is DOCX or HTML, so do not rely on it for those formats.



