POST/v1/collections
Render many images from one template: a CSV with one row per image, or a list of items
One template and up to 1000 images in one call. Send csv (a header row, then one row per image: a column named after a {{placeholder}} fills it, layer.property sets that layer's property, a column starting with _ is kept as metadata) or items; or POST the CSV itself as text/csv, options in the query string.
The answer is 202 with every image's id and final url already assigned, plus csv (how each column was read) and warnings (columns and placeholders that match nothing). Images render in the background: poll GET /v1/collections/{id} or pass webhook_url. It is all reserved first, one image per row: if the plan has fewer left, it's 429 and nothing is charged.
{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"csv": "title,author,photo.src,_post\nWhat we learned running Postgres at 40 TB,Dana Reyes,https://example.com/a.jpg,101\n\"Queues, retries and idempotency\",Sam Okafor,https://example.com/b.jpg,102\n",
"scale": 2,
"webhook_url": "https://example.com/hooks/collection"
}
curl -X POST "https://api.imageapis.com/v1/collections" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"csv": "title,author,photo.src,_post\nWhat we learned running Postgres at 40 TB,Dana Reyes,https://example.com/a.jpg,101\n\"Queues, retries and idempotency\",Sam Okafor,https://example.com/b.jpg,102\n",
"scale": 2,
"webhook_url": "https://example.com/hooks/collection"
}'
import requests
r = requests.post("https://api.imageapis.com/v1/collections", headers={"X-API-Key": "YOUR_KEY"}, json={
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"csv": "title,author,photo.src,_post\nWhat we learned running Postgres at 40 TB,Dana Reyes,https://example.com/a.jpg,101\n\"Queues, retries and idempotency\",Sam Okafor,https://example.com/b.jpg,102\n",
"scale": 2,
"webhook_url": "https://example.com/hooks/collection"
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/collections", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"csv": "title,author,photo.src,_post\nWhat we learned running Postgres at 40 TB,Dana Reyes,https://example.com/a.jpg,101\n\"Queues, retries and idempotency\",Sam Okafor,https://example.com/b.jpg,102\n",
"scale": 2,
"webhook_url": "https://example.com/hooks/collection"
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
200With response=binary: the file itself, with X-Image-Id and X-Image-Url headers
202Accepted: rendering in the background; the record has status pending and the webhook gets the finished one
{
"id": "col_5kq2wz8xmtnb4hdc7vre",
"object": "collection",
"status": "pending",
"total": 2,
"completed": 0,
"failed": 0,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"format": "png",
"scale": 1,
"units": 2,
"source": "csv",
"csv": {
"rows": 2,
"delimiter": "comma",
"variables": [
"title",
"author"
],
"modifications": [
"photo.src"
],
"metadata": [
"_post"
]
},
"warnings": [],
"images": [
{
"index": 0,
"id": "img_7hk2mq9ztbw4e6nrcxpd",
"status": "pending",
"url": "https://img.imageapis.com/i/img_7hk2mq9ztbw4e6nrcxpd.png",
"metadata": {
"post": "101"
}
},
{
"index": 1,
"id": "img_9xw4nq2kdtbz7hmc3vpe",
"status": "pending",
"url": "https://img.imageapis.com/i/img_9xw4nq2kdtbz7hmc3vpe.png",
"metadata": {
"post": "102"
}
}
],
"created": "2026-10-10T19:02:11Z",
"expires": "2026-11-09T19:02:11Z"
}