Skip to content

POST /v1/render

Render a document from a template and data. Returns either a download URL or the rendered output inline.

Endpoint:

POST /v1/render

You can render either a saved template (by ID) or an inline template (passed directly in the request).

Option A — Saved template:

{
"templateId": "your-template-id",
"data": { "orderNumber": "ORD-9876", "customer": "Acme Corp" },
"format": "pdf"
}

Option B — Inline template:

{
"template": {
"formatVersion": 1,
"meta": { "name": "Badge" },
"dimensions": { "width": "3in", "height": "2in" },
"elements": [
{
"id": "name",
"type": "text",
"position": { "mode": "absolute", "x": "10mm", "y": "15mm" },
"width": "60mm",
"height": "10mm",
"contentExpression": "attendeeName",
"style": { "fontSize": "14pt", "fontFamily": "Arial" }
}
]
},
"data": { "attendeeName": "Jane Smith" },
"format": "png"
}
FieldTypeRequiredDescription
templateIdstringOne of templateId or template is requiredID of a published template (from the dashboard or GET /v1/templates).
templateobjectOne of templateId or template is requiredInline template object. See Templates for the full schema.
dataobjectYesData to bind into the template. Top-level keys become variables in contentExpression bindings.
formatstringYesOutput format: "pdf", "png", "zpl", or "html".
dpinumberNoResolution for PNG output. Default: 300. Ignored for other formats.
deliverystringNo"url" (default) returns a JSON response with a download URL. "inline" returns the rendered output directly as the response body.

Status: 200 OK

{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "complete",
"format": "pdf",
"url": "https://api.binderypress.dev/v1/render-outputs/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"sizeBytes": 12345,
"renderTimeMs": 450
}
FieldTypeDescription
idstringUnique render job ID (UUID).
statusstring"complete".
formatstringThe output format.
urlstringDownload URL. Valid for 7 days.
sizeBytesnumberOutput file size in bytes.
renderTimeMsnumberTime spent rendering in milliseconds.

The response also includes rate limit headers.

Status: 200 OK

The response body contains the rendered document directly. The Content-Type header matches the format:

FormatContent-Type
pdfapplication/pdf
pngimage/png
zpltext/plain
htmltext/html
Terminal window
curl -X POST https://api.binderypress.dev/v1/render \
-H "Authorization: Bearer bp_sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "abc123",
"data": {
"orderNumber": "ORD-9876",
"customer": "Acme Corp",
"items": [
{ "name": "Widget A", "qty": 10 },
{ "name": "Widget B", "qty": 5 }
]
},
"format": "pdf"
}'
Terminal window
curl -X POST https://api.binderypress.dev/v1/render \
-H "Authorization: Bearer bp_sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": {
"formatVersion": 1,
"meta": { "name": "Badge" },
"dimensions": { "width": "3in", "height": "2in" },
"elements": [
{
"id": "name",
"type": "text",
"position": { "mode": "absolute", "x": "10mm", "y": "15mm" },
"width": "60mm",
"height": "10mm",
"contentExpression": "attendeeName",
"style": { "fontSize": "20pt", "fontFamily": "Arial", "fontWeight": "bold" }
}
]
},
"data": { "attendeeName": "Jane Smith" },
"format": "png",
"dpi": 150
}'

Render ZPL for label printer (inline delivery)

Section titled “Render ZPL for label printer (inline delivery)”
Terminal window
curl -X POST https://api.binderypress.dev/v1/render \
-H "Authorization: Bearer bp_sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "label-template-id",
"data": { "sku": "WIDGET-001", "quantity": 50 },
"format": "zpl",
"delivery": "inline"
}' \
-o label.zpl
StatusCodeCause
400BAD_REQUESTMissing required fields or invalid format.
400INVALID_TEMPLATETemplate failed validation. Check details.errors.
401AUTH_REQUIREDMissing or invalid API key.
404NOT_FOUNDTemplate ID not found (when using templateId).
413PAYLOAD_TOO_LARGERequest body exceeds 1 MB.
429RATE_LIMITEDToo many requests. Retry after the Retry-After period.
429QUOTA_EXCEEDEDMonthly quota exceeded (hard-capped plans only).
502RENDER_ERRORRendering failed in the container.