Batches
Cards render on demand at a URL, so you never need to generate them ahead of time. A batch is for the case a URL can't serve: when you need the files: to upload into a CMS media library, to embed in an email tool that won't fetch a dynamic image, or to keep as an archive.
POST https://ogsmith.app/api/batches
Authorization: Bearer og_yourkey
{ "name": "Back catalogue",
"rows": [
{ "key": "launch-post", "params": { "title": "Introducing our API" } },
{ "key": "pricing", "params": { "title": "Simpler pricing", "template": "minimal" } }
] }Each row's params are exactly the parameters /api/og takes, so anything you can render one at a time you can render in bulk, including templates, sizes and url. Rows count against your monthly quota, because they are real renders. A row that fails is recorded with its error and the rest carry on.
OGsmith works through a batch one slice at a time. There is no background queue: the submit call renders the first ten cards, and the response tells you whether it finished. If it didn't, call POST /api/batches/:id/run until finished is true. The dashboard does this for you.
GET https://ogsmith.app/api/batches/:id # status and per-row results POST https://ogsmith.app/api/batches/:id/run # render the next slice GET https://ogsmith.app/api/batches/:id/download # zip of the rendered cards
We keep rendered images for 24 hours and then delete them, because a batch is a handoff, not file hosting. Pass "storeImages": false to validate a set of rows without keeping anything, which is a cheap way to find the broken ones before a migration.