Rendering API
One POST turns a template into a file.
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "format": "png", "variables": { "title": "Summer sale" } }'
You get { "url" } back. Set "raw": true to get the file bytes instead.
Brand for one call
{{ brand.* }}resolves the same way as in the editor and on the template's public page: the brand the template names, else the space default.- Pass
brand(an id, name, or website URL of a brand in your space) to render under another brand for that call only. Three brands means three calls, and nothing is written back to the template. - Pass
brandTokensto replace the resolved brand for that call. Omitted tokens do not inherit from the saved brand.
The API tab
The template's API tab shows the same request. What the sample includes:
- Show all brand tokens adds every token the template uses, plus the tokens those depend on. A typography style includes its resolved sizes and the font roles it needs. Unrelated styles are left out. Dynamic token access keeps the group that was accessed.
- Show advanced options adds scale, quality, draft, and the frame, scene, or fps for that format. A still sample includes a real layer id when one exists. Remove
nodeIdto render the whole artboard. WebP samples include compression options. Campaign mode appears when you pick campaign ids and do not pass tokens. - Copy POST request copies the sample on screen. The Playground always sends the full set used by the current preview. The samples set
raw: truebecause their response code saves the file bytes. Advanced examples do not change the Playground request.
POST /api/v1/templates/:id/render
Authentication: Authorization: Bearer <API key> with the template.render scope. The key must belong to the space that owns the template. Rate limit: 30 requests per minute per key.
Path: :id is the template ID (from the editor URL, list_templates over MCP, or GET /api/v1/templates/public).
Request body (JSON, all optional):
| Field | Type | Description |
|---|---|---|
format | png | webp | svg | pdf | webm | mp4 | gif | zip | html5 | Output format. Default png. zip is a per-frame PNG sequence; html5 is a standalone HTML5 ad ZIP. |
clickUrl | string | Required for html5: absolute HTTP(S) destination URL. |
loops | integer (1–10) | HTML5 playback repetitions. Default 1; holds the final frame. |
network | generic | google-ads | dv360 | cm360 | amazon-dsp | adroll | HTML5 ad network preset the report is judged against. Default generic. |
variables | object | Variable overrides by name, e.g. { "title": "Summer Sale", "count": 3 }. Unset variables keep the template's saved values. |
brand | string | Render under another brand of the key's space, for this render only: a brand id, a brand name, or the brand's website URL (matched against your brands, never fetched or created). The template is not changed. Another space's brand — a public catalog brand included — is BRAND_NOT_FOUND (404); a name or URL matching several brands is BRAND_AMBIGUOUS (409, data.candidates lists their ids). Not with brandTokens. The response echoes brand: { id, name }. |
brandTokens | object | Brand token values for this render, replacing the resolved brand. Does not change the saved brand kit. |
brandVariant | string | string | Saved brand campaign variant IDs. Used when brandTokens is omitted. |
brandVariantMode | replace | add | Replace the applied campaign set (default), or add to it. |
webpQuality | integer (1–100) | WebP compression quality. Default 90. |
webpLossless | boolean | Use lossless WebP compression. Default false. |
draft | boolean | Render the current document instead of the published snapshot. Default false: a published template renders what was last published (served from cache); a never-published one renders its draft either way. |
scale | number (0.25–4) | Resolution multiplier. Default 1 (the template's own pixel size). |
dpi | integer (72–1200) | pdf only: the page size is the pixel size × 72 / dpi. Default: the template's export setting, else 300 on a print size (A4, US Letter, A5, A3, business card, certificate, 4×6 shipping label) so the PDF comes out at paper size, else 72 (1 px = 1 pt). See Page size. |
fps | integer (1–60) | Frames per second for video formats. Default 30. |
quality | standard | high | Render quality tier. Defaults to the template's setting, else high. |
scene | integer | Still formats: which scene to render (0-based). Default: the master frame — except a pdf of a still (non-animated) template, which holds every scene as a page unless you pass scene. |
pages | "all" | Still formats (png, webp, svg): render every page of a still template as one still each, plus a ZIP of them — see Render every page. Exclusive with scene and nodeId. |
frame | integer | Still formats: frame index within the scene. Default 0. |
nodeId | string | Still formats: render one layer instead of the artboard — its box becomes the output size. |
variation | string | string | A saved variation to apply before rendering, by its name as the Variations panel shows it (case does not matter) or its id (the # button in that panel copies it) — or several (a JSON array, or comma-separated in a query string), stacked in order: later wins on the same property, and at most one per single-select group (VARIATION_CONFLICT). |
size | string | object | Render at another size without changing the template: a size preset id (og, story, leaderboard, …), "1200x628", or { "preset": "og" } / { "width": 1200, "height": 628 }. 16–8192 px a side, 64 megapixels max. See Rendering at another size. |
fit | reflow | scale | How the design adapts to size. reflow (default) resizes the scene and lets layer constraints and auto-layout re-lay it out; scale scales the whole design uniformly to fit, letterboxed on the scene background. |
raw | boolean | Stream the file bytes instead of returning JSON. ?format=binary or ?output=binary on the query string does the same. |
Timings
The JSON response carries timings. renderMs and uploadMs are the render itself and the upload to storage. phases breaks both down in ms:
queueMs— waiting for a render workerbootMs— a cold worker startdeviceMs— GPU device acquire (~0 when warm)fontsMs— web and custom fonts, disk-cachedassetsMs— image and video decodeframeMs— the GL renderencodeMs— PNG or WebPstoreMs— the upload itselfresolveMsandbrandMs— the template, space, brand and credit lookups around the render
Alongside the file
Credits are charged after the response is sent. The JSON also says what this render cost: creditsCharged (credits taken from the key's space; a PDF counts its pages) and balanceAfter (the space's spendable credits once that charge lands, read when the credits were reserved, so other renders in the same space can move it). Raw responses carry the same two numbers as x-credits-charged and x-credits-balance headers.
On a template with verified documents on, the JSON also carries credential: { id, url, code, reused }: the document this render issued, whose verify page {{ credential.url }} printed into the design. Raw responses name it in the x-credential-id and x-credential-url headers instead.
Thumbnails and colour data for the stored file are generated after the response, so they never hold it up. Every render response, JSON or binary, also carries the timing as headers: x-render-ms (the render, in ms) and a standard Server-Timing header with render, upload (JSON responses only) and the same phases, so HTTP tools and browser devtools show the breakdown without parsing the body. Signed image URLs send both when the image is actually rendered, not when it is served from cache.
raw: true is the fastest path when you want the file itself: the bytes come back in the response body and nothing is uploaded or recorded, so the request costs the render alone (the playground's Bytes only toggle does this).
Response (default): application/json
{
"ok": true,
"templateId": "TEMPLATE_ID",
"format": "png",
"url": "https://…/render.png",
"still": { "scene": null, "frame": 0, "nodeId": null }
}
The file is uploaded to your space's storage; url is where to fetch or display it. still is present for still formats, credential for a template with verified documents on, variation echoes the applied variation, and pages is the page count of the output (a PDF's pages, or the stills of a pages: "all" render). warnings appears when the output differs from the editor, as [{ nodeId, name, reason }] (nodeId and name are null for notes about the whole document). The rest of the output still renders, so check it when a layer is missing or looks different. It covers:
- Skipped or substituted layers: a source that failed to load (drawn as a flat fill) or a raster too large for the GPU (skipped).
- SVG and PDF fallbacks: a layer saved as pixels instead of vectors (
rasterized: conic fill,rasterized: text animation blur, a 3D tilt, shader or video), a fill drawn as a simpler paint (… approximated as a solid), and fonts or images that could not be embedded. - Text animation (
textAnimate): text captured partway through its animation exports exactly as that frame looks, so some characters, words or lines may be hidden or out of place (textAnimate exported as a still of the current frame). To export settled text, pick a frame after the animation ends. - Text fit: a text layer with Fit set whose copy was cut (
text fit: copy truncated to 2 lines), whose box is shorter than one line, or that still does not fit at its minimum size (text fit: copy still overflows its box at the minimum size (24px)). The layer renders; shorten the copy, enlarge the box or lower the minimum. - Pagination notes (PDF): content clipped or dropped at the page cap, or pagination falling back to a single page.
- Soundtrack notes (MP4/WebM): audio layers left out because the mix holds at most 16 tracks, sources that could not be fetched, or a soundtrack that could not be mixed, in which case the video has no sound.
The in-app render and render_template over MCP return the same warnings. A frame the renderer could not draw at all fails the request rather than returning an incomplete image.
Response (raw: true or ?format=binary): the file body with its content type (image/png, application/pdf, video/mp4, …). A verified document it issued is named in the x-credential-id and x-credential-url headers.
Downloading the returned url: send a User-Agent header. Bot protection on the file host refuses a few generic library signatures. The best known is Python's urllib, whose default Python-urllib/3.x gets 403 with the body error code: 1010. requests, httpx, curl, fetch and browsers download normally. In urllib, set the header yourself: urllib.request.Request(url, headers={"User-Agent": "my-app/1.0"}). If you only want the bytes, raw: true skips the upload and the second request altogether.
Retrying safely
A request can time out or lose its connection after the render already ran and was charged. To retry without paying twice, send an Idempotency-Key header with a value you choose (1 to 255 printable ASCII characters, for example a UUID) and send the same key again on every retry of that request.
- The first request renders and is charged as usual.
- A retry with the same key and the same request (same template, body and query string) returns the first JSON answer again, with the header
Idempotent-Replayed: true. Nothing is rendered or charged, and norender.completedwebhook fires. - If the first request failed, the retry renders. If the failed attempt had already been charged, the retry is not charged again.
- A key is kept for 24 hours and belongs to the key's space. Use a fresh key for each different render.
A reused key answers 409 with the code IDEMPOTENCY_CONFLICT and a data.reason:
data.reason | When | What to do |
|---|---|---|
payload-mismatch | The key was already used for a different request. | Use a fresh key for a different render. |
in-flight | The first request with this key is still running. | Wait a moment and retry with the same key. |
raw-completed | The key belongs to a finished raw: true (or ?format=binary) render. The file is not kept, so it cannot be sent again. | The first request was charged once and the retry is not charged. Use a fresh key to render the file again. |
curl -X POST -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: 7f3c9a2e-order-1042-banner" \
-d '{"format":"png","variables":{"title":"Order 1042"}}' \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render"
Without the header, every request renders and is charged.
Examples
# PNG, saved values
curl -X POST -H "Authorization: Bearer YOUR_KEY" \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render" -o response.json
# WebP at 2x with variable overrides, bytes straight to a file
curl -X POST -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"format":"webp","scale":2,"variables":{"title":"Hello"},"raw":true}' \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render" -o out.webp
# Vector PDF (selectable text, no browser involved)
curl -X POST -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"format":"pdf","raw":true}' \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render" -o out.pdf
# MP4 of an animated creative
curl -X POST -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"format":"mp4","fps":30}' \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render"
# One layer only (a nested frame used as its own creative)
curl -X POST -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"format":"png","nodeId":"LAYER_ID"}' \
"https://bannx.com/api/v1/templates/TEMPLATE_ID/render"
GET /api/v1/templates/:id/render
The same render from a URL alone — for an <img src>, a spreadsheet cell, a webhook URL field, a browser tab. Options and variables go in the query string and the file comes back by default (the fastest path: nothing is stored). Add output=json to store it and get { url, timings } like POST.
https://bannx.com/api/v1/templates/<id>/render?title=Hello&count=3&format=webp&api_token=<RENDER_ONLY_KEY>
- Every query key that is not a render option (
format,scale,fps,quality,scene,frame,nodeId,variation,brand,brandVariant,brandVariantMode,draft,webpQuality,webpLossless,output) is a variable. Numbers andtrue/falseare coerced; everything else stays a string.variablesmay also carry a JSON object, andvar.<name>/variables[<name>]name a variable that collides with an option. - Auth:
Authorization: Bearerworks as on POST.?api_token=puts the key in the URL, which anyone who sees the URL can read — so a URL key must be a render-only key: minted with just the Template Render API scope and no MCP tools. Any other key in the URL is refused (403) with that reason. Mint one under Settings → Developers. - Published versions are served with
Cache-Control: private, max-age=60: only the viewer's own browser reuses the picture, for a minute.draft=trueis never cached. - Every call is a new render and costs credits, the same as a POST. If a page that many people view loads this URL in an
<img>, each view renders again and is charged to your space. To show one image to many viewers, use a signed image URL instead: it renders once per distinct URL and is served from storage after that.
<!-- fine for a page only you open; for a public page, sign the URL instead -->
<img src="https://bannx.com/api/v1/templates/<id>/render?title=Hello&api_token=<RENDER_ONLY_KEY>" alt="Hello">
Signed image URLs
GET /r/:id?name=Ada&format=webp&sig=… — an image URL with no key in it. The sig is an HMAC over the template id and every parameter, made with your space's signing secret: anyone can open the URL, nobody can change name= without the signature failing (403). That is what makes it safe to paste where a key never should go — an email, a CRM merge field, an og:image, an <img> on any site.
<img src="https://bannx.com/r/<id>?name=Ada&plan=Team&format=webp&sig=<SIGNATURE>" alt="">
- Renders once. Each distinct URL renders on its first open (1 credit, from the owning space) and every open after that streams the stored file, with
Cache-Control: public, max-age=31536000, immutableand anETag. Republishing the template changes the cached version, so existing URLs pick up the new design — and pay once more. - Still formats only:
png(default) orwebp;scaleup to 2;scene(one page of a still template, 0-based),frame,nodeId,variation,brandVariant,sizeandfitas on the render API (size=oggives a 1200 × 630 share image without changing the template).brandtoo: sign with a brand id, name or URL of your space and the URL carries the brand's id, covered by the signature (a URL whose brand was since deleted answers400). Every other key is a variable.draftis not accepted — the published version, always. exp(unix seconds) makes a URL stop rendering after a date.- Answers
404for an unpublished template,403for a missing, wrong or expired signature,400for an option out of range.
Minting URLs
In the app: the template's URL tab signs the form's current values into one link.
POST /api/v1/templates/:id/signed-urls (Bearer key with the Template Render API scope) signs one variable set or up to 500 rows — one URL per recipient:
{
"rows": [
{ "variables": { "name": "Ada", "plan": "Team" } },
{ "variables": { "name": "Grace", "plan": "Scale" } }
],
"options": { "format": "webp" }
}
→ { "templateId": "…", "published": true, "urls": [{ "url": "https://bannx.com/r/<id>?…&sig=…", "path": "/r/…", "variables": { … } }] }. Signing is free; published: false means the URLs will 404 until you publish. Over MCP the same call is sign_template_urls.
Every page of a carousel: add pages: "all" and each row becomes one URL per page of a still template — its scenes, a scene repeated over data one per item of that row's variables — each signed with its scene index, so the links for a whole carousel exist before anything is rendered (each page renders on its first open, 1 credit). Every returned row then carries scene and page: { "index", "name" }. It cannot be combined with options.scene or nodeId, and a call signs at most 50 pages a row and 500 URLs in all.
Signing offline
A CRM that merges {{first_name}} into the URL at send time cannot call the API per recipient — sign there instead. The template's URL tab → Signing secret shows the space's secret (owners and admins). The signature is:
sig = base64url( HMAC-SHA256( secret, templateId + "\n" + canonicalQuery ) )
where canonicalQuery is every parameter except sig, keys sorted, each key=value percent-encoded per RFC 3986 (encodeURIComponent plus !'()*), joined with &. Leave format out for png. Node:
import { createHmac } from "node:crypto";
const enc = (s) => encodeURIComponent(s).replace(/[!'()*]/g, (c) => "%" + c.charCodeAt(0).toString(16).toUpperCase());
const params = { name: "Ada", format: "webp" };
const canonical = templateId + "\n" + Object.keys(params).sort().map((k) => `${enc(k)}=${enc(params[k])}`).join("&");
const sig = createHmac("sha256", secret).update(canonical).digest("base64url");
const url = `https://bannx.com/r/${templateId}?${Object.keys(params).sort().map((k) => `${enc(k)}=${enc(params[k])}`).join("&")}&sig=${sig}`;
Rotating the secret — Rotate next to the secret: every URL signed so far stops working, which is what rotating means.
Output
Formats, variable markup, another size, and codes.
Formats
png/webp— raster stills.webpis smaller;pngkeeps transparency losslessly.svg— vector still. Text stays text; effects the vector format cannot express are rasterised in place.pdf— vector PDF assembled server-side; see multi-page PDFs below.webm/mp4/gif— the creative's timeline rendered as video (giffor short loops).zip— every frame as a PNG, for your own encoder or compositing.
Stills of an animated creative render the master frame by default; use scene and frame to pick a moment.
Formatted text
Any string variable bound into a text layer can carry inline formatting. The value is a small HTML subset — the same tags the canvas text editor writes — and it is parsed into styled runs at render time; nothing is ever rendered as HTML. Tags you don't see here are dropped and their text kept.
| Markup | Effect |
|---|---|
<b>…</b> / <strong> | bold (weight 700) |
<i>…</i> / <em> | italic |
<u>…</u> | underline |
<s>…</s> / <strike> / <del> | strikethrough |
<font color="#hex">…</font> | text colour for the run |
<mark color="#hex">…</mark> | highlight — a marker-pen box behind the run |
<mark>…</mark> | highlight in the layer's own first highlight colour (set by the designer in the Highlight section) |
<br> | line break (\n in the value works too) |
<span style="font-weight:700; font-style:italic; text-decoration:underline"> | the same styles by inline CSS, for values that come out of a rich-text editor |
Nesting works (<b><i>…</i></b>). Everything else about the run — font, size, alignment, highlight padding and corner radius — comes from the layer, so a template author designs it once and the request only says which words. Literal <, > and & in copy are written as <, >, &.
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/render \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{
"format": "png",
"variables": {
"headline": "Save <b>20%</b> on <mark color=\"#fde047\">everything</mark> — <font color=\"#0ea5e9\">this week only</font>"
}
}'
Declaring the variable as { "type": "string", "format": "richtext" } gives the template's form a formatting toolbar for it; the API accepts the markup either way.
A code variable ({ "type": "string", "format": "code" }) holds source code for a code layer. Send it as an ordinary JSON string: newlines (\n), tabs and indentation reach the render unchanged, and {{ }} inside the code (Vue, Handlebars, Jinja) prints verbatim. See code variables.
A signature variable ({ "type": "string", "format": "signature" }) takes an image: a data:image/png;base64,… (or SVG) data URL, or an https:// URL to a signature image. The template's form collects it with a draw / type / upload pad. See signature variables.
{ "format": "pdf", "variables": { "recipient": "Ada Lovelace", "signature": "https://example.com/signatures/jane.png" } }
Rendering at another size
A template is designed at one size, but the same design is often needed as a story, an OG image or a leaderboard. Pass size on any render and the engine renders that size from the template as it is, the way the editor's own resize would, without saving anything:
{ "size": { "preset": "story" }, "variables": { "title": "Summer sale" } }
size takes a preset id from the editor's size picker (instagram-post, story, og, leaderboard, medium-rectangle, a4, hd, …), a "WIDTHxHEIGHT" string, or { "width", "height" }. Custom sizes are bounded to 16–8192 px a side and 64 megapixels; anything else is a 422. A template may also carry an allowed-sizes list; a size outside it is a 422 naming what is allowed. The response carries size: { width, height, fit, preset?, from: { width, height } } so a caller can see what ran.
How the design adapts is fit:
reflow(default): the scene takes the new size and the design re-lays itself out exactly as it does when the artboard is resized in the editor. Layers pinned with constraints (left / right / center / stretch / scale, in the Layout section) keep their margins to the new edges, top-level layers sized fill follow the scene, and auto-layout frames rewrap. Layers with none of those keep their pixel position and size. A template built with constraints adapts across a family of sizes; one built with fixed pixels does not, andscaleis the better choice for it.scale: the whole design is scaled uniformly to fit inside the new box and centred, so a square post becomes a letterboxed landscape with the scene background on either side. Nothing re-lays out.
The same parameter works on GET renders (?size=og&fit=scale), signed image URLs (size and fit are signed options), and the MCP render_template tool. HTML5 ad exports judge the network's accepted sizes against the rendered size, so size: "leaderboard" on a medium-rectangle ad is checked as a 728×90.
Codes per render
A QR code or barcode layer encodes its layer Value; bind that to a variable and each request prints its own code:
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/render \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "format": "pdf", "variables": { "attendee": "Ada Lovelace", "ticketUrl": "https://tickets.example/c/8f3a" } }'
For certificates, ID cards and badges, bind the QR code to {{ credential.url }} instead and turn on verified documents: each render then gets its own verify page, hosted by bannx, that you can revoke later.
Video
When a template plays, and how its audio is mixed.
Animated templates and video length
A template is animated — its page plays it and offers video formats (mp4, webm, gif, zip) next to the stills — when it has keyframes, video or audio layers, compositions, scene transitions, a shader that uses time (a moving gradient, noise, grain) or a binding on $time / $frame. Otherwise it is a still. When detection gets it wrong, switch on Keep as still under Template settings → Output to offer stills only (MCP: apply_template_ops { settings: { motion: "still" } }; null resets to auto).
A still template's scenes are pages. Set Pages to Carousel under Template settings → Output and its page shows them side by side, gliding to the page a form field changes (MCP: settings: { pageView: "carousel" }). This changes the preview only; every render stays the same. See Pages.
A video export runs for the sum of the scene durations — set each scene's length in the editor timeline (MCP: updateScene { sceneIndex, patch: { duration } }); fps sets the frame rate. The motion setting also decides how a PDF treats scenes: a still template's scenes are pages, an animated template's PDF is one scene.
Soundtrack (audio layers)
mp4 and webm exports carry one audio track that mixes every audio layer that is not muted, hidden or switched off (up to 16) — music, voice-over and sound effects together, timed the way the editor plays them:
- A layer inside a scene starts at that scene's start plus its
startAt(Cue) and stops when the scene ends, so a voice-over line belongs in the scene it narrates. - A layer on the master track (added in the editor's Master view, or over MCP with
addNode { dest: "master" }) starts at itsstartAtand runs to the end of the video, which suits background music. trimStartandtrimEnd(seconds into the file) cut the sound to an in-point and an out-point, andplaybackRate(0.0625–16, default 1) speeds it up or slows it down with its pitch kept — the same props a video layer takes. In the editor, drag the edges of the layer's clip bar on the timeline, or set In, Out and Speed in the inspector.loop: truerepeats that span (the whole file when untrimmed) until then;loop: falseplays it once.volume(0–1, default 1) is the layer's gain — a new audio layer starts at full volume. Keyframe it (MCP:setKeyframes { tracks: { volume: [...] } }) to fade music in or out, or to duck it under a voice-over; keys sit on the layer's own clock.- Inside a composition the sound restarts with every loop of the composition.
- An audio layer is never drawn, so it has a 1×1 box and its position has no effect. Select it from the layer list.
gif, zip and stills carry no audio and never fetch it. An audio or video src may be an absolute https URL or a path on this app (/uploads/…), the same as an image. When a source can't be fetched it is left out of the mix and the rest still plays.
Page count from the content, or one page per scene.
Page size
A PDF page is the design's pixel size divided by its dpi, times 72 points per inch. A template on a print size prints at that paper size without scaling: the A4 preset (2480 × 3508 px) gives a 210 × 297 mm page, a business card (1050 × 600 px) a 3.5 × 2 in page, and the 4×6 shipping label (1200 × 1800 px) a 4 × 6 in page, because those sizes default to 300 dpi. Any other size defaults to 72 dpi, one pixel per point. Text and shapes stay vectors at every dpi; dpi changes the page size, not the sharpness.
Set the default per template in the editor under Template settings → Output → PDF size (Auto, 72, 150, 300 or 600 dpi, with the resulting page size shown for the current artboard), with exportDefaults.dpi over MCP, or pass dpi on one render. A size change (size) is applied first, so size: "a4" on a social template gives an A4 page.
Multi-page PDFs (auto-pagination)
One designed scene can become a PDF whose page count follows the content — invoices with any number of line items, catalogs, reports. In the editor, turn on Auto-paginate PDF export on the scene and give its frame a column auto-layout (or mark column frames inside it as flow regions). Content in the flow is what gets split, typically a repeat layer bound to your data; everything outside it (headers, footers, backgrounds) repeats on every page. Then render with format: "pdf" — the layout engine measures the content, packs it into as many pages as it needs (up to 50) and merges them into one PDF, with pageNumber and totalPages available to text layers for "Page 2 of 7" footers, and to a layer's Show if and bindings (in every other render — a PNG, an SVG, a PDF that does not paginate — they resolve to 1 of 1). A scene without a column flow renders as a single page. PDF renders cost one credit per generated page. The JSON response carries pages, the page count of the file, so a caller can tell a 1-page invoice from a 7-page one without opening it; the MCP tool reports the same field and can switch pagination on for a template.
Multi-scene PDFs
A still template (see Animated templates — no keyframes, media, transitions or time-based shaders, or Motion set to Still) treats its scenes as pages: the front and back of a business card, a brochure's spreads, a carousel sent as one document. Rendering it with format: "pdf" and no scene or nodeId produces one page per scene, in scene order (a scene that auto-paginates contributes all of its pages in place). Pass scene to export just one. An animated template's scenes are moments in a timeline, so its PDF stays a single scene. The response's pages reports the total, and each page costs a still's credits.
Render every page (carousels)
The same pages as separate images: a carousel's slides for a social post, a deck's cards, a brochure's spreads as PNGs. Pass pages: "all" with a still format (png, webp or svg) and the template renders one still per page, in page order — one per scene, and a scene repeated over data one per item, resolved with the request's variables (so a 4-slide slides list is 4 files). The JSON answer counts them in pages (the same integer a PDF render reports), lists them in pageUrls and adds a ZIP:
{
"ok": true,
"templateId": "TEMPLATE_ID",
"format": "png",
"pages": 2,
"pageUrls": [
{ "index": 0, "name": "Cover", "url": "https://…/01-Cover.png", "fileId": "FILE_ID_1" },
{ "index": 1, "name": "Pricing", "url": "https://…/02-Pricing.png", "fileId": "FILE_ID_2" }
],
"zipUrl": "https://…/pages.zip",
"creditsCharged": 2
}
Each index is the scene a single render of that page takes; name is the page's name (a templated scene name is filled in); fileId is the page's file in your media library — what a social post attaches (Post a carousel). With raw: true the body is the ZIP itself (application/zip, an x-page-count header), its files numbered in page order: 01-Cover.png, 02-Pricing.png, … Every page costs a still's credits, reserved up front: a space that cannot cover the whole set gets a 402 before anything renders. pages: "all" is for still templates (an animated template's scenes are moments — render a video, or one scene with scene), cannot be combined with scene or nodeId, and renders at most 50 pages per request (PAGE_LIMIT_EXCEEDED); a pdf already holds every page, so the two are exclusive (422). On the template page, the export menu's Download all pages (ZIP) and the editor's All pages export option run this same render; over MCP it is render_template { pages: "all" }. To hand out a keyless link per page instead of rendering now, sign the URLs with pages: "all". A spread layer (one layer laid out across several pages) prints on each page the part that falls on it.
Bulk rendering
One request, one file per row, packed into a ZIP, or merged into one PDF. Queued — the response is a job id you poll.
# start: rows are variable values by name (optional id / name keys name each file)
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/bulk \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "format": "png", "rows": [ { "title": "One", "price": "€9" }, { "title": "Two", "price": "€12" } ] }'
# → { "ok": true, "jobId": "…", "total": 2 }
# poll until state is completed (or failed)
curl https://bannx.com/api/v1/templates/bulk/JOB_ID -H "Authorization: Bearer YOUR_API_KEY"
# → { "jobId", "state": "active", "total": 2, "completed": 1, "succeeded": 1, "failed": 0, "currentItem": "…", "errors": [] }
# → { …, "state": "completed", "output": "zip", "zipUrl": "https://…/renders.zip" }
On a template with verified documents on, every rendered row issues one, and the finished job lists them as credentials: [{ row, credentialId, url, code, reused }] (row is the row's id, else its position counted from 1).
With "format": "pdf", "output": "pdf" the rows are merged, in row order, into one PDF instead of a ZIP: a sheet of shipping labels or a batch of certificates to print in one go. The finished job carries "output": "pdf" and fileUrl in place of zipUrl. A row that fails is left out and listed in errors.
| Field | Notes |
|---|---|
rows | array of objects, max 500 — each becomes one file; unset variables keep the template's saved values. A dotted key fills part of an object or list variable: "to.name" sets to.name and keeps the saved to.city, "items.0.qty" fills the first item of a list. A string holding JSON ({…} or […]) fills a whole object or list variable. A row's file in the ZIP is named after its name key (else its first text value); a reserved _filename key names it exactly, for example "_filename": "certificate-ada-okafor" (leave the extension off; it never reaches the template). Characters other than letters, digits, -, _ and spaces are dropped, and a repeated name gets the row number added. |
format | png, webp, svg, pdf, mp4, webm, gif (default png) |
pages | "all": every page of a still template as its own file, for every row, named <row>-01-<page>.png, <row>-02-<page>.png, … Each page costs a still's credits. png, webp or svg only (a PDF already holds every page), and not together with a row's _scene. |
output | zip (default): one file per row in a ZIP. pdf: every row merged into one PDF; needs format: "pdf" (422 otherwise). |
dpi | pdf only, as for a single render (Page size) |
scale, fps, quality, variation | as for a single render; quality is low / medium / high here. variation styles every row. |
variants | Render every row once per look: 200 rows and "variants": ["gold", "silver", "bronze"] give 600 files. Each entry is a variation name or id, or a list of them to combine in one file (["gold", "dark"], or "gold,dark"); "" is the row as it is set. Each look is stacked on top of the row's _variation, else the run's variation. Files are named <row>-<look> (ada-Gold.png), and the "" look keeps the plain name. At most 10 looks and 1000 files a run; every file costs a render. |
size, fit | as for a single render: every row renders at that size. A row overrides it with a reserved _size (and _fit) field in its data, a CSV column or a JSON key, so one run can deliver a story for one record and a square for the next; the fields never reach the template as variables. |
A row can also carry its own render options as reserved keys (a CSV column or a JSON key). Like _size, they never reach the template as variables, and a mistake in any row refuses the whole run with that row named, before any credit is used.
| Row key | Notes |
|---|---|
_filename | The row's file name in the ZIP (see rows). |
_variation | A saved variation name or id, or several separated by commas, for this row. It replaces the run's variation for that row: one template can print a gold certificate for the winners and a plain one for everyone else. |
_scene | Still formats: the page to render for this row, counted from 0 (0 is the first page). A row whose design has fewer pages fails on its own and is listed in errors. With a video format it is a 422: a video plays the whole design. |
_credentialKey | Verified documents: who this row's document belongs to, such as an email or a member number. It overrides the template's subject key variable: the same holder with unchanged fields keeps their document, changed fields replace it. Stored only as a one-way hash. |
The balance must cover every row when the job is accepted (402 if the wallet is short); each row then reserves its credit as it renders and a row that fails to render costs nothing. The template must live in the key's space. A CSV is the same request once parsed. Without code, open the template page's Bulk tab, set Rows from to CSV file and choose the file (header row = variable names, dotted headers like to.name for object variables, _size / _fit for a row's own size, _filename for a row's own file name, _variation and _scene for its own variation and page, _credentialKey for the holder of its verified document, up to 500 rows): every line becomes a checked row you can hover to preview, then Render N files. The style picked under Choose style on the Form tab applies to every row, and Render each row as on the Bulk tab (templates with saved variations) asks for variants: check Gold and Silver to get both versions of every row. Playground on the same tab takes a CSV or JSON rows and runs exactly this API request, with the same look toggles and a button that adds a _variation key to each row. A blank CSV cell is left out of its row, so the template keeps its saved value there. The One PDF switch on the Bulk tab (format PDF) asks for output: "pdf", and Every page (PNG, WebP or SVG on a template that does not animate) asks for pages: "all".
Credits
Renders are paid from the space's credits: the key's space on this API, your space in the app (including a gallery download of someone else's public template).
| Output | Cost |
|---|---|
Still (png, webp, svg) | 1 credit |
Every page (pages: "all") | 1 credit per page, reserved up front |
| 1 credit per page | |
Clip (webm, mp4, gif, zip) | 5 credits |
Billing sets both defaults. A 7-page invoice costs 7. A 2-scene business card costs 2. The first PDF page is reserved up front. Later pages must be covered before the file is delivered, or you get a 402 naming the page count and nothing is charged.
Credits are reserved before the render and taken when it succeeds. Two renders racing for the last credit get one hold. A failed render releases the hold. Out of credits is 402. A retried job or a duplicate delivery is not billed twice, and neither is a POST retried with the same Idempotency-Key (see Retrying safely). The JSON API, render_template, and the in-app render report creditsCharged and balanceAfter, so you can attribute your own spend instead of diffing the space balance. Thumbnails, previews, and the editor canvas are free. Credits from a top-up pack never expire. The plan's monthly credits are spent first, then pack credits.
AI calls (chat, image, speech, asset tools) reserve an estimate, then settle to what the call cost. A reservation that never settles is released within about 15 minutes.
Every prompt that generates an image or a video (the assistant's image tool, asset tools, mockup scene notes, workflow AI nodes) is screened before it reaches a model. A declined prompt returns 422 with the code PROMPT_REJECTED and nothing is reserved or charged; rephrase it to follow the Acceptable Use Policy. See Errors.
Rate limits
Each endpoint limits how often one API key can call it (the public verify and report endpoints count per IP address instead): the render endpoints 30 requests a minute, bulk 6 a minute. Every response from a limited endpoint says where your key stands:
| Header | Example | Meaning |
|---|---|---|
RateLimit-Policy | "default";q=30;w=60 | The limit: q requests per w seconds |
RateLimit | "default";a=29;w=60 | a requests left, w seconds until the window resets |
X-RateLimit-Limit | 30 | Same limit, for clients that read the older headers |
X-RateLimit-Remaining | 29 | Requests left in this window (never below 0) |
X-RateLimit-Reset | 60 | Seconds until the window resets (not a timestamp) |
Retry-After | 58 | On a 429 only: seconds to wait before retrying |
RateLimit and RateLimit-Policy follow the IETF RateLimit header fields draft. When a request is over the limit you get 429 with the code RATE_LIMITED: wait the Retry-After seconds, then retry. The counts are your own (your key's, or your IP address's on the per-IP endpoints); they never include another key's requests. A request refused before the limit is counted (a missing or invalid key, 401) carries none of these headers, and a few endpoints send none: read-only ones with no limit, and the cached public template search.
Render logs
Every render is logged for your space. In the editor, open the Render Logs panel to inspect recent requests (status, timings, format, and the requesting key).
Errors
Every error carries a stable data.code — TEMPLATE_NOT_FOUND, CREDITS_EXHAUSTED, RATE_LIMITED, VARIATION_NOT_FOUND, NODE_NOT_FOUND, BRAND_VARIANT_INVALID, SCOPE_DENIED, URL_KEY_NOT_RENDER_ONLY… — beside the HTTP status and a message. The full list, with what to do about each, is on the Errors page.
While a space's verified documents are suspended, a template that issues them is refused with CREDENTIALS_SUSPENDED (403); other templates render as usual.
Webhooks
Renders can trigger webhooks (e.g. upload result, update a log). See Webhooks.
Versioning and deprecation
The REST API is versioned in its path: every endpoint, on this page and in the other guides, lives under /api/v1.
- Additive changes ship at any time and are not breaking: new endpoints, new optional request fields, new response fields and new error codes. Ignore response fields you do not know, and handle an unknown
data.codeby its HTTP status. - Breaking changes get at least 6 months' notice before they take effect. A breaking change removes or renames an endpoint or a field, changes a field's type, or tightens validation of input that is accepted today.
- During the notice period the operation is marked
deprecated: truein/openapi.json, and its responses carry two headers:Deprecation(RFC 9745): the date the operation was deprecated, as Unix seconds after an@, e.g.Deprecation: @1801439999.Sunset(RFC 8594): the date it stops working, as an HTTP date, e.g.Sunset: Sat, 31 Jul 2027 23:59:59 GMT. It is never earlier than theDeprecationdate.- When a guide describes the replacement, a
Linkheader withrel="deprecation"points to it, and the operation'sx-deprecationobject in/openapi.jsonrepeats the two dates (date,sunset) and thatlink.
- Where notice is published: in these docs, on the guide for the affected endpoint (what replaces it and when the old one stops), and in
/openapi.json. Log theDeprecationheader in your integration to catch a notice without reading the docs. - Exception: a fix for a security vulnerability, or a change a legal requirement forces, may take effect with shorter notice when waiting would put customers or their data at risk. It is still announced in these docs.
Nothing is deprecated today.
HTML5 ads
Export one scene as a standalone HTML5 ad ZIP.
- Template page: HTML5 ad (ZIP) beside Download. Set the destination URL and loops. A sandboxed preview plays at the real pixel size, with a replay button, the creative and backup sizes, and any budget warnings. The ZIP is saved only when you confirm, using the preview's variables, brand, and layout. Anonymous iframe embeds cannot export HTML5.
- Editor: document Export panel → HTML5 ad (ZIP). Browser export opens that same preview, then downloads on confirm. Server export uses the render pipeline. Both export the current scene, with fonts and images included.
The Render API also accepts:
{
"format": "html5",
"clickUrl": "https://example.com/collection",
"scene": 0,
"loops": 2,
"raw": true
}
Send this to POST /api/v1/templates/:id/render with a template.render API key, or call the MCP tool render_template with the same fields (format: "html5", clickUrl, loops, network); its result includes adReport and a link to the ZIP.
raw: true returns application/zip; omit it to receive the usual stored-file
URL. Variables, brand tokens, published/draft selection, tenant permissions and
credit accounting follow the existing render pipeline. HTML5 exports cost one
render. zip continues to mean a PNG frame sequence.
Each ZIP contains index.html, a small player, local image assets and a
backup.png: the ad's final frame at its pixel size, which networks show where
HTML5 cannot run (it becomes backup.jpg when the PNG alone would exceed the
budget). Most networks take the backup as a separate upload, so drag it out of
the ZIP when asked; the size budget below is measured without it. Fonts are
embedded. Unzip it to preview, or serve the directory as static files. It runs
without Bannx and loads no external resources. This first release targets generic
HTML5 hosting; it does not certify compatibility with a particular ad network.
HTML5 supports static content and position, rotation, scale and opacity animation. It plays from the beginning of the selected scene and stops on the final frame of the final loop. Reduced-motion viewers see the final frame. Unsupported static effects are flattened. Unsupported animation, missing assets or missing fonts stop export with an explanation.
Multi-scene templates require scene. frame and nodeId are not supported.
scale controls raster fallback resolution; the ad keeps its authored dimensions.
Variable, brand and $parent bindings are resolved before export and ship as
static values. Video/audio, component instances, nested timelines, bindings on
$time/$frame, bindings that override an animated property, animated masks,
spatial motion paths, camera/scene transitions, backdrop/motion blur and
animation inside flattened groups are not supported in this release.
Image assets keep their original format (PNG, JPEG, WebP, GIF) and are only downscaled when they are larger than twice the ad box at the requested scale; SVG images are rasterized to PNG because SVG cannot ship inside an ad.
HTML5 JSON responses include adReport with errors (what stopped the export; empty when the ZIP is usable), warnings, compressed zipBytes, creativeBytes (the ZIP without the backup image), backupBytes, fileCount, files (uncompressed bytes per file) and network (the preset used). Warnings are judged against the chosen network preset and name it. Raw responses (raw: true / ?format=binary) carry the same report as headers: X-HTML5-Ad-Warnings (a count) and X-HTML5-Ad-Report (the adReport object as single-line JSON, ASCII-escaped; when it would exceed 8 KB the per-file map is dropped first, then the warning list is cut with warningCount and truncated: true set).
Network presets
Pick the network the ad is going to and the export is checked against that network's published upload limits: creative ZIP size, file count, animation length, loop count, backup image size and accepted pixel sizes. Limits are the networks' creative specs as of October 2026; confirm against the network before a large campaign.
network | ZIP | Files | Animation | Loops | Backup | Sizes |
|---|---|---|---|---|---|---|
generic (default) | 150 KB | – | 30 s | 3 | – | any |
google-ads | 600 KB | 40 | 30 s | – | – | standard display sizes |
dv360 | 5 MB downloaded | 100 | 30 s | – | separate upload | any |
cm360 | 9.5 MB | 100 | 30 s | – | 40 KB, separate upload | any |
amazon-dsp | 200 KB | – | 30 s | – | 40 KB | fixed desktop and mobile set |
adroll | 150 KB | – | 30 s | – | – | any |
The preset also appears in the template page and editor export panels, and the in-app preview states which network the warnings were checked for.