Render (Templates)
Render a saved React JSX template with dynamic data. Templates are managed in the dashboard or via the templates API.
POST
/v1/renderRequest
| Field | Type | Description |
|---|---|---|
template required | string | Template name |
data required | object | Props passed to the React component |
engine | "rust" | "puppeteer" | Rendering engine (default: rust) |
test | boolean | Test mode (free, watermarked) |
options | object | Page size, margins, etc. |
hosting | object | Enable hosted download |
Request body
{
"template": "monthly-invoice",
"data": {
"company": { "name": "Acme Corp" },
"items": [
{ "description": "Web Design", "qty": 1, "price": 2500 }
],
"total": 2500
},
"options": { "page_size": "A4" }
}Response (200)
{
"id": "conv_kP3xNqWm",
"status": "completed",
"document_id": "doc_8c2ef1a3",
"page_count": 1,
"duration_ms": 29,
"template": "monthly-invoice",
"template_version": 3
}The response includes template and template_version for traceability. Send Accept: application/pdf to receive raw PDF bytes. This endpoint also supports hosting options for public download links with expiration, limits, and password protection.