Batch renders
A batch renders one template once per row of values — product cards from a catalogue, certificates from a class list, listings from a spreadsheet — in one call. You send the template, the options every row shares and up to 1,000 rows; the call answers at once with a batchId and the rows render in the background. Each row becomes an ordinary render request (rnd_…): it shows in render history (where GET /v1/renders marks it with "batch": { "batchId": "bat_…", "row": 3 }), fires the usual render webhooks and is charged like a single render — only if it succeeds.
- A failed row keeps its error and the other rows carry on.
- Too many rows, or not enough credits for every row, is refused before anything runs.
- When the last row ends, one
batch.completedwebhook is sent. - A finished batch downloads as one ZIP of every file plus
results.csv.
POST /v1/renders/batch
/v1/renders/batchscope: render:writeStart a batch: one template, the options every row shares, and one entry per row. Answers 202 with the batch.
| Param | Type | Notes |
|---|---|---|
| templateId* | tpl_… | The template's public id. |
| items* | array (1–1,000) | One entry per render: { modifications, fileName? }. modifications works exactly like a single render’s, page-scoped keys (page2@headline) included; an empty value keeps the template’s own. |
| items[].fileName | string | Names this row’s file(s) in the ZIP. Defaults to row-<n>. |
| format | "png" | "jpeg" | "pdf" | "mp4" | "webm" | "gif" | Defaults to png. Applies to every row. |
| allPages | boolean | Render every page per row (one file per page; a PDF is one file). |
| pageId | string | Which page to render when allPages is off. |
| video | object | fps, scale, quality — as on a single render. Video formats only. |
| animation | object | Per-render timing, as on a single render. |
| idempotencyKey | string | Send the same key again and you get the same batch back — nothing runs twice. |
curl -X POST https://buildonce.app/v1/renders/batch \
-H "Authorization: Bearer fl_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "templateId": "tpl_123", "format": "png", "idempotencyKey": "spring-sale-2026", "items": [ { "modifications": { "headline": "Summer sale", "photo": "https://…/a.jpg" }, "fileName": "summer-sale" }, { "modifications": { "headline": "Autumn deals", "page2@price": "$19" }, "fileName": "autumn" }, { "modifications": { "headline": "Winter warmers" } } ] }'{
"templateId": "tpl_123",
"format": "png",
"idempotencyKey": "spring-sale-2026",
"items": [
{ "modifications": { "headline": "Summer sale", "photo": "https://…/a.jpg" }, "fileName": "summer-sale" },
{ "modifications": { "headline": "Autumn deals", "page2@price": "$19" }, "fileName": "autumn" },
{ "modifications": { "headline": "Winter warmers" } }
]
}The 202 response is the batch with status: "queued" and every row waiting — the same shape as GET /v1/batches/:batchId. A publish block is not accepted on a batch (400).
GET /v1/batches/:batchId
/v1/batches/:batchIdscope: render:writeA batch's progress and every row: its status, its renderId and files once it succeeded, or its error. Poll it while the batch runs — it is exempt from the plan's per-minute limit.
| Param | Type | Notes |
|---|---|---|
| status | "queued" | "processing" | "succeeded" | "partial" | "failed" | "canceled" | partial: some rows failed. canceled: it was stopped. finishedAt is set once every row has ended. |
| items[].status | "queued" | "processing" | "succeeded" | "failed" | "canceled" | Each row on its own. |
| remaining | number | Rows not ended yet. |
| options | object | The shared options the batch ran with — send failed rows again with the same settings. |
curl https://buildonce.app/v1/batches/bat_89acrvdg3k4y \ -H "Authorization: Bearer fl_live_YOUR_API_KEY"
{
"batchId": "bat_89acrvdg3k4y",
"templateId": "tpl_123",
"templateName": "Spring sale · Square",
"templateThumbnailUrl": "https://…/thumbnail/p1.png",
"format": "png",
"options": { "allPages": false },
"status": "partial",
"total": 3,
"succeeded": 2,
"failed": 1,
"canceled": 0,
"remaining": 0,
"creditsCharged": 2,
"createdAt": "2026-11-24T09:15:00.000Z",
"finishedAt": "2026-11-24T09:15:42.000Z",
"items": [
{
"row": 1,
"status": "succeeded",
"fileName": "summer-sale",
"modifications": { "headline": "Summer sale", "photo": "https://…/a.jpg" },
"renderId": "rnd_wdbw5wrmp2wg",
"files": [{ "url": "https://…/renders/45ae….png", "pageId": "s1", "width": 1080, "height": 1080, "byteSize": 482113 }],
"creditsCharged": 1,
"error": null
},
{
"row": 2,
"status": "failed",
"fileName": "autumn",
"modifications": { "headline": "Autumn deals", "page2@price": "$19" },
"renderId": null,
"files": [],
"creditsCharged": 0,
"error": { "status": 400, "code": "IMAGE_FETCH_FAILED", "message": "Image from \"example.com\" could not be loaded: HTTP 404" }
}
/* … one entry per row */
]
}GET /v1/batches
/v1/batchesscope: render:writeThe workspace's batches, newest first, without their rows.
| Param | Type | Notes |
|---|---|---|
| page | number | Defaults to 1. |
| limit | number | Defaults to 25, max 100. |
| status | "running" | "done" | "errors" | "stopped" | running: not finished. done: every row succeeded. errors: partial or failed. stopped: canceled. |
| search | string | Part of the template's name. |
curl "https://buildonce.app/v1/batches?status=errors&limit=10" \ -H "Authorization: Bearer fl_live_YOUR_API_KEY"
POST /v1/batches/:batchId/cancel
/v1/batches/:batchId/cancelscope: render:writeStop a batch. Rows not started yet become canceled and are never charged; rows already rendering finish. Returns the batch.
curl -X POST https://buildonce.app/v1/batches/bat_89acrvdg3k4y/cancel \ -H "Authorization: Bearer fl_live_YOUR_API_KEY"
To carry on later, send the canceled rows (their modifications and fileName are in the batch) as a new batch. Canceling a finished batch changes nothing.
GET /v1/batches/:batchId/zip
/v1/batches/:batchId/zipscope: render:writeEvery file of a finished batch as one ZIP, plus results.csv. Streamed as it is written, so even a very large batch starts downloading at once.
| Param | Type | Notes |
|---|---|---|
| from | number | First row to include (1-based). |
| to | number | Last row to include. |
curl -L https://buildonce.app/v1/batches/bat_89acrvdg3k4y/zip \ -H "Authorization: Bearer fl_live_YOUR_API_KEY" \ -o batch.zip
- Files are named by the row’s
fileName, elserow-<n>; a multi-page row adds-p1,-p2…; duplicate names get-2. results.csvlists every row — row, status, file_name, render_id, urls, error_code, error_message — so you can bring the links back into your own sheet.- 409
BATCH_NOT_FINISHEDwhile it runs. Over 4 GB is 413BATCH_ZIP_TOO_LARGE: download it in parts withfromandto. A range that selects no rows (fromafterto, or past the last row) is 400BATCH_ZIP_RANGE_INVALID; atopast the end just stops at the last row.
Limits & credits
| Param | Type | Notes |
|---|---|---|
| Rows per batch | Free: 50 · paid: 1,000 | Over it is 400 BATCH_TOO_LARGE, before anything runs. |
| Video rows | 100 | mp4, webm or gif: one row can take minutes to render. |
| Credits | as a single render | 1 per image or PDF page, 1 per started video second — charged per row, only when it succeeds. Not enough credits for every row is 402 before anything runs. |
| Speed | background | Rows render one after another on their own lane, so a big batch never holds up your single renders. 500 images take about 8 minutes. |
batch.completed webhook
Subscribe a workspace webhook to batch.completed to hear once when the last row ends — instead of polling. Each row still sends its own render.completed or render.failed.
{
"type": "batch.completed",
"data": {
"batchId": "bat_89acrvdg3k4y",
"status": "partial",
"total": 500,
"succeeded": 498,
"failed": 2,
"canceled": 0,
"creditsCharged": 498
}
}Errors
| Param | Type | Notes |
|---|---|---|
| 400 BATCH_TOO_LARGE | create | More rows than the plan or format allows. Split the rows into smaller batches. |
| 402 INSUFFICIENT_CREDITS | create | The workspace can’t pay for every row. Nothing was queued or charged. |
| 503 BATCH_UNAVAILABLE / QUEUE_UNAVAILABLE | create | Batches can’t be queued right now. Try again; nothing was charged. |
| 404 BATCH_NOT_FOUND | get, cancel, zip | No batch with that id in this workspace. |
| 409 BATCH_NOT_FINISHED | zip | The batch is still rendering. |
| 400 BATCH_ZIP_RANGE_INVALID | zip | from is after to, or past the batch’s last row. |
| 413 BATCH_ZIP_TOO_LARGE | zip | Over 4 GB — use from / to. |
A row’s own failure (a broken image link, an unknown page…) is not an HTTP error: it is that row’s error, with the same code a single render would return.
Was this page helpful?