Render a template (GET)
Render a template by ID from the URL alone: options and variables as query parameters, the file streamed back by default (`output=json` stores it and returns `{ url }`). Every query key that is not a render option is a template variable, e.g. `?title=Hello&count=3`; `variables` may also be a JSON object string, and `var.<name>` / `variables[<name>]` name a variable that collides with an option. Auth: `Authorization: Bearer` or `?api_token=` — a key in the URL must be scoped to the Template Render API only (a render-only key), so leaking the URL leaks nothing else.
/api/v1/templates/:id/renderQuery / Path parameters
| Name | In | Required | Description |
|---|---|---|---|
| id | path | Yes | Template ID |
| api_token | query | No | A render-only API key (endpoint scope exactly template.render, no MCP tools). Alternative to the Authorization header. |
| format | query | No | png (default), webp, svg, pdf, webm, mp4, gif, zip, html5 |
| clickUrl | query | No | Required for html5: absolute HTTP(S) destination URL |
| loops | query | No | HTML5 repetitions: 1–10, default 1 |
| network | query | No | HTML5 network preset: generic (default), google-ads, dv360, cm360, amazon-dsp, adroll |
| output | query | No | `json` to store the file and return { url, timings } instead of the bytes |
| scale | query | No | Resolution multiplier 0.25–4 |
| quality | query | No | standard | high |
| scene | query | No | Still formats: scene index. Omit on a pdf of a still (non-animated) template to get every scene as a page. |
| frame | query | No | Still formats: frame index within the scene |
| nodeId | query | No | Still formats: render one layer |
| variation | query | No | Saved variation id, or several comma-separated (stacked in order; at most one per single-select group) |
| brand | query | No | Render with another brand of the key's space for this render only: a brandId, brand name or the brand's website URL. The template keeps its own brand. Another space's brand is BRAND_NOT_FOUND (404); a name matching several brands is BRAND_AMBIGUOUS (409). |
| brandVariant | query | No | Brand campaign variant id(s), comma-separated |
| draft | query | No | `true` renders the current document instead of the published version |
| size | query | No | Another output size: a preset id (og, story, leaderboard, …) or WIDTHxHEIGHT; the template is not changed |
| fit | query | No | reflow (default) | scale — how the design adapts to `size` |
| dpi | query | No | PDF only: print resolution 72–1200 (page = pixels × 72 / dpi points). Default: the template's exportDefaults.dpi, else 300 on a print-size template, else 72 |
| variables | query | No | JSON object of variables (optional — bare keys work too) |
Responses
The rendered file (default; `x-credits-charged` / `x-credits-balance` headers carry what it cost, and on a template with verified documents on `x-credential-id` / `x-credential-url` name the document it issued), or JSON { ok, templateId, format, url, timings, creditsCharged, balanceAfter, brand?, credential? } with output=json — `credential` { id, url, code, reused } is the verified document this render issued
Missing or invalid API key
The key lacks the template.render scope, or a URL key is not render-only, or the space's verified documents are suspended (CREDENTIALS_SUSPENDED)
Template not found in the key's space, or `brand` names no brand of the key's space (BRAND_NOT_FOUND)
`brand` matches several brands of the space (BRAND_AMBIGUOUS)
curl -X GET "https://bannx.com/api/v1/templates/:id/render" \
-H "Authorization: Bearer YOUR_API_TOKEN"// Binary image (image/png, image/svg+xml, or image/webp)
// Or data URL for inline format