About this endpoint
What it does
Generates a certificate document from JSON content and rendering options. The request body includes the certificate data plus optional page and output settings; the response returns rendered document metadata and, for supported formats, a data_uri with the encoded output.
Request Body
| Parameter | Type | Description |
|---|---|---|
| data | Object | Certificate content. Includes the certificate fields documented below. |
| data.date | String | Certificate date. Max length 32. |
| data.title | String | Certificate title. Default: Certificate of Completion. Max length 200. |
| data.issuer | String | Issuer name. Max length 200. |
| data.recipient | String | Recipient name. Max length 200. |
| data.signatory | String | Signatory name or null. Default: null. Max length 200. |
| data.statement | String | Text between the recipient and the achievement. Default: has successfully completed. Max length 500. |
| data.achievement | String | Achievement text. Max length 500. |
| data.accent_color | String | Hex color in #RRGGBB format. Default: #1f4e79. |
| data.certificate_id | String | Certificate ID or null. Default: null. Max length 64. |
| page | Object | Paper size and margins for PDF output. Includes the page fields documented below. |
| page.size | ENUM | Paper size. 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 | Page orientation. Allowed values: portrait, landscape. Default: portrait. |
| format | ENUM | Output format. Allowed values: json, html, pdf, docx. Default: json. pdf, html, and docx return the bytes; json returns a PDF data URI plus metadata. |
| download | Boolean | Sends Content-Disposition: attachment so browsers save the file. Default: false. |
Response
Returns a JSON object with rendering metadata: bytes (integer), cache (string), pages (integer, nullable), engine (string), format (string), data_uri (string), warnings (array of string), queued_ms (integer), render_ms (integer), media_type (string), and engine_version (string). The format field is limited to docx, pdf, or html.
| Parameter | Type | Description |
|---|---|---|
| bytes | Integer | Size of the rendered output in bytes. |
| cache | ENUM | Cache result. Allowed values: hit, miss. |
| pages | Integer | PDF page count. null for DOCX/HTML. |
| engine | String | Rendering engine used. |
| format | ENUM | Returned format. Allowed values: docx, pdf, html. |
| data_uri | String | Data URI in the form data:<media_type>;base64,…. |
| warnings | String Array | Warning messages returned by the renderer. |
| queued_ms | Integer | Time spent queued, in milliseconds. |
| render_ms | Integer | Rendering time, in milliseconds. |
| media_type | String | MIME type of the rendered output. |
| engine_version | String | Rendering engine version. |



