Queue render job
POST/office/render-jobs
Queues a new asynchronous document render job for a published template. The job is processed by the background worker; poll /render-jobs/{id} until status is "completed" or "failed". On completion, the resulting artifact is available via /documents/{id}/download.
Request
Request body
Content type application/json (required).
| Field | Type | Required | Description |
|---|---|---|---|
template_id | integer | Yes | ID of the published template to render. |
binding_data | object | Yes | Key-value merge data matching the template's declared merge fields. |
output_formats | array of string | No | Output formats to produce. Defaults to the template's default output formats. |
reference_id | string | No | Optional external reference (e.g. "invoice:42") used to associate this job with a source record. |
reference_type | string | No | Type of the referenced record (e.g. "invoice", "contract"). |
Example
{
"template_id": 3,
"binding_data": {
"invoice_number": "INV-2026-0042",
"client_name": "Acme Corp",
"issue_date": "2026-04-08",
"due_date": "2026-04-22",
"line_items": [
{
"description": "Enterprise CRM licence",
"quantity": 5,
"unit_price": 800.0
}
],
"total": 4000.0
},
"output_formats": [
"pdf"
],
"reference_id": "invoice:42",
"reference_type": "invoice"
}
Responses
202 Render job queued successfully
Content type application/json, object · OfficeRenderJobV1.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | No | Auto-incremented primary key. |
template_id | integer | No | ID of the template used for this render job. |
status | string | No | Current lifecycle status of the render job. One of: |
output_formats | array of string | No | List of output formats requested for this job. |
reference_id | string, nullable | No | Optional external reference identifier (e.g. "invoice:42") for linking the job to a source record. |
reference_type | string, nullable | No | The type of the referenced record (e.g. "invoice", "contract"). |
artifacts | array of object, nullable | No | Output artifacts produced by a completed job. Null while still queued or processing. |
artifacts[].format | string | No | The output format of this artifact. |
artifacts[].document_id | integer | No | ID of the document artifact (use for /documents/{id}/download). |
artifacts[].size_bytes | integer | No | File size of the artifact in bytes. |
error_message | string, nullable | No | Human-readable error reason when status is "failed". |
queued_at | string (date-time) | No | |
completed_at | string (date-time), nullable | No |
Example
{
"id": 88,
"template_id": 3,
"status": "queued",
"output_formats": [
"pdf"
],
"reference_id": "invoice:42",
"queued_at": "2026-04-08T12:00:00Z",
"completed_at": null
}
422 Validation failed — check template_id, binding_data keys, or output_formats
503 Office worker is unavailable — check /office/runtime/health
Example request
curl -X POST "https://{tenant}.faciotech.net/api/v1/office/render-jobs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"template_id": 3, "binding_data": {"invoice_number": "INV-2026-0042", "client_name": "Acme Corp", "issue_date": "2026-04-08", "due_date": "2026-04-22", "line_items": [{"description": "Enterprise CRM licence", "quantity": 5, "unit_price": 800.0}], "total": 4000.0}, "output_formats": ["pdf"], "reference_id": "invoice:42", "reference_type": "invoice"}'