Webhooks
Webhooks tell your server when something finishes or changes in your space. When a render completes, a workflow run ends, or a brand, shader or content entry changes, bannx POSTs a JSON event to your URL. If you set a secret, every request carries an HMAC-SHA256 signature you can check. You don't have to poll the Render API, and your own system (a CMS, a queue, a Slack bot) can act the moment a file is ready.
Space owners and admins manage webhooks in Settings → Space → Developers → Webhooks.
Automation tools can add their own: a Zapier New Render trigger shows here as Zapier · render.completed while its Zap is on, and an n8n Bannx Trigger as n8n · render.completed while its workflow is active. Each goes away when the Zap or workflow is turned off.
Set one up
- Click Add Webhook.
- Give it a Name and a Post URL: a public
https://endpoint you control. - Under Triggers, tick the events you want. They are grouped by module.
- Optional: enter a Secret so deliveries are signed, and add Custom headers your receiver expects (for example
Authorization: Bearer …). - Leave Enabled on and click Save.
Make a render through the Rendering API and the first render.completed delivery appears in the webhook's history a moment later.
Events
Events are grouped by module, the same way permissions are grouped on the roles page. Tick the exact actions you care about.
| Module | Event key | Fires when | data |
|---|---|---|---|
| Rendering | render.completed | A render is stored: POST /api/v1/templates/:id/render, the GET render URL with output=json, render_template over MCP, or a render from the editor. | Render metadata (below) |
| Workflows | workflow.executed | A workflow run finishes, from the Process API or a form submission. | workflowId, runId, status, output or error |
| Brands | brand.created | A brand is created. | { doc }, the brand |
| Brands | brand.updated | A brand's tokens or details are updated. | { doc }, the brand |
| Brands | brand.deleted | A brand is deleted. | { id } |
| Shaders | shader.created | A shader passed vetting and was stored. | { doc } |
| Shaders | shader.updated | A shader's source, manifest or details changed. | { doc } |
| Shaders | shader.deleted | A shader is deleted. | { doc }, as it was |
| Shaders | shader.statusChanged | A shader was revoked, quarantined or restored. | { doc } |
| Shaders | shader.quarantined | Enough watchdog trips were reported that the shader was disabled space-wide. | { doc } |
| Content | entry.created | A content entry is created in a collection. | { id, entryTypeId } |
| Content | entry.updated | A content entry is updated. | { id, entryTypeId } |
| Content | entry.published | A content entry is published (fires as well as entry.created / entry.updated). | { id, entryTypeId } |
| Content | entry.deleted | A content entry is deleted. | { id, entryTypeId } |
| Content | entryType.created | A content type (collection) is created. | { id } |
| Content | entryType.updated | A content type's fields or settings are updated. | { id } |
| Content | entryType.deleted | A content type is deleted. | { id } |
Content events carry ids, not the entry itself. Fetch the entry when you need its fields.
What does not fire render.completed: raw: true renders and the default GET render (the bytes go straight back to you and nothing is stored), signed image URLs, and bulk jobs, which you poll by job id instead.
Delivery payload
Every delivery is a POST with a JSON body:
{
"id": "b7c1e0f2-…",
"event": "render.completed",
"timestamp": "2026-11-05T10:00:00.000Z",
"spaceId": "665f…",
"data": {
"templateId": "TEMPLATE_ID",
"format": "png",
"url": "https://…/render.png",
"timings": { "renderMs": 412, "uploadMs": 96, "phases": { "frameMs": 180, "encodeMs": 41, "storeMs": 88 } },
"still": { "scene": null, "frame": 0, "nodeId": null }
}
}
idis unique per event. A retry of the same delivery keeps it, so use it as your idempotency key.timestampis when the event was emitted (ISO 8601).datadepends on the event; see the table above.
A Render API render.completed carries the same fields as the JSON response, without ok, creditsCharged and balanceAfter: templateId, format, url and timings, plus still, pages, variation, size, brand and warnings when they apply. A pages: "all" render adds pageUrls and zipUrl, and its url is the ZIP. Renders from MCP or the editor send a shorter data: templateId, format and url (the editor adds still).
A workflow.executed event:
{
"event": "workflow.executed",
"data": {
"workflowId": "…",
"runId": "…",
"status": "completed",
"output": { "url": "https://…/out.png", "mimeType": "image/png", "width": 1080, "height": 1080 }
}
}
status is completed or failed (with an error message instead of output). A run that stops at an approval step reports awaiting-approval. A text-only workflow puts the result in output.text.
Headers we set
| Header | Description |
|---|---|
Content-Type | Always application/json. |
X-Webhook-Id | The webhook's id. |
X-Webhook-Event | The event key (e.g. render.completed). |
X-Webhook-Delivery | The delivery id (matches id in the body). |
X-Webhook-Timestamp | ISO timestamp the event was emitted (matches timestamp). |
X-Webhook-Signature | sha256=<hex>, an HMAC-SHA256 of the raw body keyed with your secret. Only sent when a secret is set. |
Verifying the signature
Set a Secret on the webhook and every delivery is signed. Recompute the HMAC over the raw request body, the exact bytes you received, and compare it to X-Webhook-Signature in constant time. Re-serialising parsed JSON changes whitespace and key order, and the check fails.
Node with Express:
import express from 'express'
import { createHmac, timingSafeEqual } from 'node:crypto'
const app = express()
function verify(rawBody: Buffer, header: string | undefined, secret: string): boolean {
if (!header) return false
const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex')
const a = Buffer.from(header)
const b = Buffer.from(expected)
return a.length === b.length && timingSafeEqual(a, b)
}
// express.raw keeps the body as bytes so the HMAC sees what bannx signed
app.post('/bannx-webhook', express.raw({ type: 'application/json' }), (req, res) => {
if (!verify(req.body, req.get('x-webhook-signature'), process.env.BANNX_WEBHOOK_SECRET!)) {
return res.status(401).end()
}
const event = JSON.parse(req.body.toString('utf8'))
res.status(204).end() // answer fast, then do the work
queueJob(event)
})
Python with Flask:
import hashlib, hmac, os
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["BANNX_WEBHOOK_SECRET"].encode()
@app.post("/bannx-webhook")
def bannx_webhook():
raw = request.get_data() # bytes, before any JSON parsing
expected = "sha256=" + hmac.new(SECRET, raw, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers.get("X-Webhook-Signature", "")):
abort(401)
event = request.get_json()
# dedupe on event["id"], then hand off to a queue
return "", 204
Reject any request whose signature does not match. The signed body includes timestamp, so you can also refuse events older than a few minutes to block replays. Retries reuse the original timestamp and end within about a minute. Resend sends a fresh one.
Custom headers
Add any number of custom headers to a webhook, for example a bearer token your receiver checks, or a routing hint. They are sent on every delivery. Reserved headers (Content-Type, User-Agent and the X-Webhook-* headers above) cannot be overridden: a custom header with one of those names is skipped.
Delivery and retries
- Deliveries run outside the request that triggered them. A failing or slow receiver never fails the render or save, and the API response is not delayed.
- Each attempt times out after 10 seconds.
- A network error, a timeout, a
5xxor a429is retried: 3 attempts in all, 5 seconds and then 25 seconds apart. Other4xxresponses and redirects are final and are not retried. - Redirects are never followed. A
3xxcounts as a failed delivery. - A
410 Goneturns the webhook off. It tells us the subscription no longer exists (Zapier answers it for a deleted Zap), so bannx stops posting to it. Settings → Developers shows Receiver gone on that webhook; switch it back on once the URL works again. - Only public URLs are allowed. The Post URL must be a public
httpsaddress: private, loopback, link-local and cloud-metadata targets are rejected when you save and checked again at every delivery. - Only enabled webhooks whose triggers include the event receive it. An event goes to every matching webhook in the space.
Your endpoint should answer with a 2xx quickly and do heavy work (downloading the file, re-posting it) asynchronously. A receiver that times out may still have processed the event, and the retry delivers it again with the same id, so make your handler idempotent.
Delivery history and resend
Every delivery is logged. Open a webhook's history (the clock icon, View recent deliveries) to see:
- Status:
success,failed, orblocked(rejected by the URL check). - The response code your endpoint returned and the duration of the request.
- When it fired, and the error message on failures (hover the timestamp).
The history shows one row per delivery, with the outcome of its last attempt. Use Resend to replay a past delivery: it sends the same event and data again with a fresh delivery id, timestamp and signature, so you can retry after fixing your endpoint. Delivery records are kept for 3 months, then removed automatically. Deleting a webhook also removes its history.
Common problems
| Symptom | Cause and fix |
|---|---|
| Save fails with "Webhook URL must use https" | Production webhooks need https://. Put your receiver behind TLS. |
| Save fails with "…resolves to a private, loopback, or internal address" | The host points at 10.x, 192.168.x, 127.0.0.1, 169.254.x or similar. Expose the receiver on a public address or use a tunnel. |
| "Webhook host could not be resolved" | The hostname has no DNS record yet. Check spelling and DNS. |
History shows blocked | The host resolved to a private address at delivery time, though it looked public when you saved. Fix the DNS record. |
History shows failed, "Redirect not followed" | The URL answers with a 3xx (often http → https or a missing trailing slash). Point the webhook at the final URL. |
| Webhook shows Receiver gone | Its URL answered 410 Gone, so it was turned off. Fix or replace the URL, then switch the webhook back on. |
History shows failed, "Timed out" | Your endpoint took more than 10 seconds. Reply 2xx first, then process. |
| Signature never matches | You are hashing parsed and re-serialised JSON, or the secret has stray whitespace. Hash the raw bytes with the exact secret you saved. |
| No delivery for a render | The render used raw: true, the default GET render, a signed URL or a bulk job (none of these fire it), or the webhook is disabled or not subscribed to render.completed. |
| The same event arrives twice | A retry after a timeout or a 5xx. Dedupe on id / X-Webhook-Delivery. |
FAQ
Can I tell which API key triggered a render? Not from the webhook. The payload carries spaceId, templateId and the render metadata. Put your own correlation id in a variable, or record the response of the request you made.
Does the webhook say what the render cost? No. creditsCharged and balanceAfter come back only to the caller, in the render response.
Do I need a secret? It is optional, but without one anyone who learns your URL can post fake events. Set a secret, or at least a custom auth header.
Can I test without making a render? Make one cheap still render with the Render API, or open an earlier delivery in the history and click Resend.
Summary
| Aspect | Description |
|---|---|
| Direction | Outbound: you supply the URL. |
| Trigger | Any subscribed event in your space. |
| Auth | HMAC-SHA256 signature (optional secret) plus optional custom headers. |
| Retries | Up to 3 attempts on network errors, timeouts, 5xx and 429; manual Resend from history. |
| Impact on API | None: delivery runs outside the request. |
Related: Rendering API · Workflows · Errors · Authentication