Batch
POST /v1/renders/batch renders up to 50 images in a single request. Items run
concurrently and are metered per item; a failure on one item never aborts the others.
# Two shapes
One template, many modification sets — the common case:
curl https://api.mostlyrender.com/v1/renders/batch \
-H "Authorization: Bearer mr_live_…" \
-H "Content-Type: application/json" \
-d '{
"template": "tpl_abc",
"output": "png",
"items": [
{ "title": "One" },
{ "title": "Two" },
{ "title": "Three" }
]
}'
Each item is a modifications object, or { "modifications": {…}, "output": "…" } to
override the format per item.
Heterogeneous renders — different templates in one call:
{
"renders": [
{ "template": "tpl_a", "modifications": { "title": "A" }, "output": "png" },
{ "template": "tpl_b", "modifications": { "title": "B" }, "output": "pdf" }
]
}
# Response
{
"results": [
{ "id": "rnd_1", "url": "https://img.mostlyrender.com/mostlyrender/renders/rnd_1.png", "output": "png" },
{ "error": "render failed" }
],
"count": 2,
"ok": 1
}
results is positional — each entry is either a render result or an { "error" }
object. count is the total processed; ok is how many succeeded.
# SDK
res = mr.render_batch(
template_id="tpl_abc",
output="png",
items=[{"title": "One"}, {"title": "Two"}, {"title": "Three"}],
)
print(res["count"], res["ok"])
For batches larger than 50, split into multiple requests, or use async jobs.