Errors
Every error from the API — REST, the GET render URL, MCP — has the same shape, and API errors carry a stable code you can branch on. Messages are written for people and may change; codes never do. A few errors raised before a request reaches its endpoint (an unknown URL, some sign-in and not-found answers) have no code: fall back to the HTTP status for those.
{
"status": 402,
"statusMessage": "Payment Required",
"message": "Not enough credits for this action — upgrade your plan or buy add-on credits.",
"data": {
"code": "CREDITS_EXHAUSTED",
"title": "Payment Required",
"message": "Not enough credits for this action — upgrade your plan or buy add-on credits."
}
}
status — the HTTP status, repeated in the body.data.code — the stable identifier. Branch on this when it is present; otherwise use status.message — what went wrong, for a log line or a support ticket. Some codes add fields beside code: validation errors carry data.fieldErrors (field → messages) and data.in (body / query / params); a bad brandVariant lists the unknown and known ids; an unknown nodeId or variation echoes the value.- Binary responses (
raw: true, GET render) still answer errors as JSON with this shape — check the status before treating the body as a file.
Rate-limited responses (429) carry Retry-After (seconds): retry after that long (Rate limits); everything else is a fixed condition until you change the request, the key or the space.
const res = await fetch(url, { method: "POST", headers, body });
if (!res.ok) {
const err = await res.json();
switch (err.data?.code) {
case "CREDITS_EXHAUSTED": notifyBilling(); break;
case "RATE_LIMITED": await sleep(Number(res.headers.get("retry-after") ?? 2) * 1000); return retry();
case "VALIDATION": console.error(err.data.fieldErrors); break;
default: throw new Error(`${err.data?.code ?? res.status}: ${err.message}`);
}
}
The verified document codes are explained with the feature in Verified documents; render errors in the Rendering API.
| Code | Status | Meaning | What to do |
|---|
AUTH_REQUIRED | 401 | No API key (or session) on a request that needs one. | Send Authorization: Bearer <key> — or ?api_token= on GET render with a render-only key. |
TOKEN_INVALID | 401 | The API key is unknown, revoked or malformed. | Check the key; mint a new one under Settings → Developers if it was deleted. |
TOKEN_EXPIRED | 401 | The key's expiry date has passed. | Mint a new key, or one without an expiry. |
SCOPE_DENIED | 403 | The key was minted without access to this endpoint or MCP tool. | Mint a key that includes the scope (e.g. Template Render API), or use a key without scope restrictions. |
URL_KEY_NOT_RENDER_ONLY | 403 | A key passed in the URL (?api_token=) can do more than render. | For URLs, mint a render-only key: endpoint scope exactly Template Render API, no MCP tools. Keys with wider access go in the Authorization header. |
FORBIDDEN | 403 | The caller is not a member of the space, or lacks the role/permission for this action. | Use a key or account from the space that owns the resource; ask an owner for the permission. |
PLAN_FEATURE_UNAVAILABLE | 403 | The space's plan does not include this feature. | Upgrade the plan. |
| Code | Status | Meaning | What to do |
|---|
CREDITS_EXHAUSTED | 402 | The space cannot reserve the credits this action needs (a still costs 1, a clip 5, a PDF 1 per page, a page scraped by a workflow 1; AI calls reserve an estimate; bulk needs the balance to cover every row up front). | Buy a credit pack or upgrade the plan; renders resume immediately. |
RATE_LIMITED | 429 | Over the endpoint's per-key (or per-user / per-IP) rate limit. | Wait the Retry-After seconds, then retry; render endpoints allow 30 requests per minute per key. The RateLimit and X-RateLimit-* headers show what is left (see /docs/rendering#rate-limits). |
IDEMPOTENCY_CONFLICT | 409 | An Idempotency-Key was reused with a different payload, its first request is still running, or it belongs to a finished raw render whose file is not kept (data.reason: payload-mismatch, in-flight, raw-completed). | Use a fresh key per distinct request, wait for the first request to finish before retrying, and use a fresh key to render a raw file again (the first one was charged once). |
| Code | Status | Meaning | What to do |
|---|
VALIDATION | 422 | The body, query or path failed validation; data.fieldErrors names each field. | Fix the listed fields. Unknown fields are rejected on strict endpoints. |
| Code | Status | Meaning | What to do |
|---|
TEMPLATE_NOT_FOUND | 404 | No template with that id in the key's space — private, deleted, or another space's. | Check the id (list_templates over MCP, or the editor URL) and that the key belongs to the owning space. |
TEMPLATE_NOT_RENDERABLE | 400 | The template has no design document to render (an empty or legacy template). | Open it in the editor, add content and save; publish if you render the published version. |
VARIATION_NOT_FOUND | 400 | The variation is neither the id nor the name of one of the template's saved variations, or it is a name two variations share. | Use the variation's name as the Variations panel shows it, or its id (the # button in that panel, or get_template over MCP); for a shared name, use the id. |
VARIATION_CONFLICT | 400 | Two of the requested variations are in the same single-select group (for example both Light and Dark from a Theme group). | Pass one variation per single-select group; multi-select variations can be stacked. |
NODE_NOT_FOUND | 400 | The nodeId is not a layer in the rendered document. | Use a layer id from the editor (right-click → Copy id) or from get_template_document. |
BRAND_VARIANT_INVALID | 400 | A brandVariant id does not exist on the template's brand, or the template has no brand. | Use a variant id from the brand's Variants section; set a brand on the template first. |
BRAND_TOKENS_INVALID | 400 | brandTokens is not a plain object, or exceeds the size / depth / string-length limits. | Send only token values as a flat-ish object; leave out anything that is not a brand token. |
PAGE_LIMIT_EXCEEDED | 422 | pages: "all" resolved to more pages than one request renders (50, the same cap as a PDF). | Render ranges one page at a time with scene, or shorten the collection the scene repeats over. |
RENDER_FAILED | 500 | The render itself failed (the worker crashed or timed out). | Retry once; if it repeats, the design has something the renderer cannot handle — check Render Logs in the editor and report the template id. |
| Code | Status | Meaning | What to do |
|---|
BULK_EMPTY | 400 | The bulk request has no active rows. | Send at least one row in rows (or an active row in contents). |
BULK_JOB_NOT_FOUND | 404 | No bulk job with that id in the key's space. | Use the jobId returned by POST …/bulk; jobs are pruned some time after completion. |
| Code | Status | Meaning | What to do |
|---|
HOOK_NOT_FOUND | 404 | No integration webhook subscription with that id in the key's space. | Use the id returned when the subscription was created. Webhooks added in Settings → Developers are managed there, not through this route. |
| Code | Status | Meaning | What to do |
|---|
BRAND_NOT_FOUND | 404 | No brand with that id readable by the key's space — or, for a render's brand parameter, no brand of the key's own space matches the id, name or website URL. | Check the id via list_brands; public catalog brands are readable by everyone, others only by their space. A render's brand only ever picks one of your space's brands — create it first (resolve_brand with a URL). |
BRAND_AMBIGUOUS | 409 | A render's brand name (or website URL) matches several brands of the space; data.candidates lists them. | Pass one of the candidate brandIds instead of the name. |
BRAND_INVALID | 400 | The brand payload is malformed (variants, groups or token shapes). | See message for the field; every variant and group needs a unique non-empty string id. |
| Code | Status | Meaning | What to do |
|---|
CREDENTIALS_SUSPENDED | 403 | This space's verified documents are suspended by bannx (for example after reports of fake documents), so renders of templates with verified documents turned on are refused and existing verify pages say the issuer is suspended. | Contact [email protected] from the space owner's account. Renders of templates without verified documents keep working. |
CREDENTIAL_NOT_FOUND | 404 | No verified document with that id. The same answer is given for a mistyped id and one that was deleted. | Check the link or the id printed beside the QR code; ask the issuer if the document should exist. |
| Code | Status | Meaning | What to do |
|---|
PROMPT_REJECTED | 422 | The prompt was declined by content screening. Every prompt that generates an image or a video is screened before the model runs; data.decision is deny or flag. | Rephrase the prompt. Generated images and videos must follow the Acceptable Use Policy (/acceptable-use). Nothing was charged. |
PROMPT_SCREENING_UNAVAILABLE | 503 | Content screening did not answer in time, so the generation did not run. | Retry in a moment. Nothing was charged. |
| Code | Status | Meaning | What to do |
|---|
SOCIAL_APPROVAL_REQUIRED | 409 | The post has not been approved, so it cannot be published, retried or queued yet. | Wait for an approver to approve it in Publish; list_social_posts shows pending_approval until then. |
SOCIAL_APPROVAL_NOT_PENDING | 409 | The post is not waiting for this approval step: it was already approved, sent back for changes, cancelled, or (for a client link) already answered. | Reload the post and act on its current status. |
SOCIAL_APPROVAL_STALE | 409 | The post's content or time changed after the version that was reviewed. | Reload the post and review the current version before approving. |
SOCIAL_APPROVAL_TIME_PASSED | 409 | The post's time has passed (or is less than a minute away), so approving it would publish it late. | Approve it with a new time (scheduledAt at least a minute ahead); an expired post is never published on its own. |
SOCIAL_APPROVAL_LINK_INVALID | 403 | The review link is wrong, expired or was replaced (the post changed or was cancelled). | Ask the sender for a new link; a link works only for the post and the person it was sent to. |
SOCIAL_APPROVALS_PLAN_REQUIRED | 403 | Approvals for social posts need a paid plan, and client approval links a plan that includes them. | Upgrade the plan, or leave approvals (or client links) off. |
SOCIAL_APPROVALS_PENDING_CHOICE | 409 | Approvals are being turned off while posts still wait for approval. | Send pending: "approve" to approve the waiting posts whose time is still ahead, or pending: "keep" to leave them waiting. |
| Status | Codes |
|---|
400 | TEMPLATE_NOT_RENDERABLE, VARIATION_NOT_FOUND, VARIATION_CONFLICT, NODE_NOT_FOUND, BRAND_VARIANT_INVALID, BRAND_TOKENS_INVALID, BULK_EMPTY, BRAND_INVALID |
401 | AUTH_REQUIRED, TOKEN_INVALID, TOKEN_EXPIRED |
402 | CREDITS_EXHAUSTED |
403 | SCOPE_DENIED, URL_KEY_NOT_RENDER_ONLY, FORBIDDEN, PLAN_FEATURE_UNAVAILABLE, CREDENTIALS_SUSPENDED, SOCIAL_APPROVAL_LINK_INVALID, SOCIAL_APPROVALS_PLAN_REQUIRED |
404 | TEMPLATE_NOT_FOUND, BULK_JOB_NOT_FOUND, HOOK_NOT_FOUND, BRAND_NOT_FOUND, CREDENTIAL_NOT_FOUND |
409 | IDEMPOTENCY_CONFLICT, BRAND_AMBIGUOUS, SOCIAL_APPROVAL_REQUIRED, SOCIAL_APPROVAL_NOT_PENDING, SOCIAL_APPROVAL_STALE, SOCIAL_APPROVAL_TIME_PASSED, SOCIAL_APPROVALS_PENDING_CHOICE |
422 | VALIDATION, PAGE_LIMIT_EXCEEDED, PROMPT_REJECTED |
429 | RATE_LIMITED |
500 | RENDER_FAILED |
503 | PROMPT_SCREENING_UNAVAILABLE |