Skip to content

Webhooks reference

Events, signature with ready-made code, retries, delivery log.

As Markdown (for AI)OpenAPI

Contents and all reference pages

A webhook sends events such as video.ready to your server by POST. Every delivery is signed following the open “Standard Webhooks” spec. You verify the signature, answer with 2xx and do the work afterwards.

This page lists all endpoints, all events, the exact signature procedure with ready-made code for JavaScript and Python, the retries and the allowed addresses.

Endpoints

Scope for all of them: webhooks:manage. Webhooks belong to one mode: a test key only sees and changes test webhooks, and test events only go to test webhooks. At most 10 webhooks per account (409 too_many_webhooks).

Method and pathPurpose
POST /webhookscreate (201); the secret is returned only here
GET /webhooksall webhooks of the mode
GET /webhooks/{id}read one webhook
PATCH /webhooks/{id}change url, events, enabled, description
DELETE /webhooks/{id}delete; answer {"id", "object": "webhook", "deleted": true}
POST /webhooks/{id}/rotate_secretnew secret; the old one keeps signing for 24 hours
POST /webhooks/{id}/testsend test.ping now, result returned
GET /webhooks/{id}/deliveriesdelivery log, newest first (limit 1–200, default 50)
POST /webhooks/{id}/deliveries/{delivery_id}/retrysend one delivery again now

Create a webhook

The answer (201) contains secret (whsec_…) once. Store it right away, for example as FLOW_WEBHOOK_SECRET. The API never shows it again.

FieldMeaning
urlrequired: public https address, up to 500 characters (rules in “Allowed addresses”)
eventslist of up to 20 events or ["*"] for all; default ["*"]
descriptionup to 200 characters
curl
curl -X POST https://flow-marketing.org/api/turbo/v1/webhooks \
  -H "Authorization: Bearer $FLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/flow-webhook", "events": ["video.ready", "video.failed"], "description": "Produktion"}'
JavaScript
const res = await fetch('https://flow-marketing.org/api/turbo/v1/webhooks', {
  method: 'POST',
  headers: { Authorization: 'Bearer ' + process.env.FLOW_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://example.com/flow-webhook', events: ['video.ready', 'video.failed'], description: 'Produktion' }),
})
const wh = await res.json()
// wh.secret (whsec_...) is shown ONLY here – store it as FLOW_WEBHOOK_SECRET
Python
import os, requests

r = requests.post(
    "https://flow-marketing.org/api/turbo/v1/webhooks",
    headers={"Authorization": "Bearer " + os.environ["FLOW_API_KEY"]},
    json={"url": "https://example.com/flow-webhook", "events": ["video.ready", "video.failed"], "description": "Produktion"},
    timeout=30,
)
wh = r.json()
# wh["secret"] (whsec_...) is shown ONLY here – store it as FLOW_WEBHOOK_SECRET
Response 201
{
  "id": "wh_3fGh7JkL9zXc1VbN5mQw",
  "object": "webhook",
  "url": "https://example.com/flow-webhook",
  "events": ["video.ready", "video.failed"],
  "mode": "test",
  "enabled": true,
  "paused_reason": null,
  "description": "Produktion",
  "success_rate_24h": null,
  "created_at": "2026-11-22T09:00:00.000Z",
  "secret": "whsec_q0Zt1n3G8oT4uJ8mVb2cW9xYzA1bC2dE"
}

Events

You can subscribe to every name in the list. Today the ones marked “yes” are fired; the others are reserved for upcoming features and do not arrive yet.

EventWhenToday
video.draft_readyvideo created or changed by PATCH, preview readyyes
video.renderingthe render is runningyes
video.readyvideo done, files availableyes
video.failedstill red after repairsyes
video.canceledrender canceledyes
balance.lowbalance covers fewer than two 60-second videos (live only, only after a top-up)yes
spending_limit.warning80 % of the monthly limit reached (live only)yes
spending_limit.reached100 % of the monthly limit reached (live only)yes
speech.completedspeech job doneyes, when “voice via the API” is on
speech.failedspeech job failedyes, when “voice via the API” is on
test.pingtest via POST /webhooks/{id}/testyes
video.fill_failedreserved – fill errors come directly as 502 fill_failed todayno
image.ready, image.failedreserved (images)no
brand.ready, brand.failedreserved (brand kits)no
asset.ready, asset.rejectedreservedno
batch.completedreserved (batches)no
balance.topped_upreserved (top-ups)no
api_key.exposedreservedno

Note: Flow Marketing checks balance and limit every 15 minutes. spending_limit.* arrives at most once per month, balance.low at most once in 24 hours.

Structure of an event

FieldMeaning
idevt_…, equal to the webhook-id header – for deduplication
objectevent
typename of the event
modetest or live
api_version2026-11-20
createdtime in Unix seconds
request_idthe request that triggered the event, otherwise null
data.objectvideo.*: the video with latest_render; balance.low and spending_limit.*: available_cents, reserved_cents, month_spent_cents, monthly_limit_cents; speech.*: the speech job; test.ping: {"object": "ping", "message"}
Sample video.ready (shortened)
{
  "id": "evt_5pN2kLm8QwRt6Yu1Io3P",
  "object": "event",
  "type": "video.ready",
  "mode": "live",
  "api_version": "2026-11-20",
  "created": 1795305600,
  "request_id": null,
  "data": {
    "object": {
      "id": "vid_7Hq2LmN0pQrS3tUv4WxY",
      "object": "video",
      "status": "ready",
      "metadata": { "customer_id": "c_1042" },
      "latest_render": {
        "id": "rnd_9KpQ2wErT5yU7iO1aS3d",
        "status": "succeeded",
        "files": { "master_16x9": { "url": "https://...", "expires_at": "...", "content_type": "video/mp4" } },
        "charge": { "amount_cents": 260, "currency": "eur", "billable_seconds": 26, "source": "balance" }
      }
    }
  }
}

Headers of a delivery

HeaderContent
content-typeapplication/json
user-agentFlowMarketing-Webhooks/1.0 (+https://flow-marketing.org/entwickler)
webhook-idid of the event (evt_…)
webhook-timestampUnix seconds of this delivery attempt
webhook-signaturev1,<base64>; during a rotation two signatures, separated by a space
flow-event-typeequal to type in the body

Verifying the signature

The procedure is the open “Standard Webhooks” spec. Instead of your own code you can use any Standard Webhooks library, for example the package standardwebhooks for JavaScript and Python.

  1. Take the raw body – exactly the bytes that arrive. Do not parse and re-serialize first.
  2. Read webhook-timestamp. If it differs from your clock by more than 5 minutes (300 seconds): reject.
  3. Build the key: cut the prefix whsec_ off the secret and Base64-decode the rest.
  4. Build the signed text: <webhook-id>.<webhook-timestamp>.<raw-body>.
  5. Compute HMAC-SHA256 with the key, Base64-encode it and put v1, in front.
  6. Compare with each signature in the webhook-signature header (separated by spaces), in constant time. If one matches, the message is genuine.
JavaScript
// Express: the RAW body is required for the signature (express.raw)
import crypto from 'node:crypto'
import express from 'express'

function verifyFlowWebhook(secret, headers, rawBody) {
  const id = headers['webhook-id']
  const ts = headers['webhook-timestamp']
  const sigHeader = headers['webhook-signature'] || ''
  const t = Number(ts)
  if (!id || !Number.isInteger(t)) return false
  if (Math.abs(Math.floor(Date.now() / 1000) - t) > 300) return false // older than 5 minutes
  const key = Buffer.from(secret.startsWith('whsec_') ? secret.slice(6) : secret, 'base64')
  const expected = Buffer.from('v1,' + crypto.createHmac('sha256', key).update(id + '.' + ts + '.' + rawBody).digest('base64'))
  // during a secret rotation the header carries two signatures, separated by a space
  return sigHeader.split(' ').filter(Boolean).some((s) => {
    const b = Buffer.from(s)
    return b.length === expected.length && crypto.timingSafeEqual(b, expected)
  })
}

const seen = new Set() // use a database in production
const app = express()
app.post('/flow-webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const raw = req.body.toString('utf8')
  if (!verifyFlowWebhook(process.env.FLOW_WEBHOOK_SECRET, req.headers, raw)) return res.sendStatus(400)
  const event = JSON.parse(raw)
  res.sendStatus(200) // answer within 10 s, work afterwards
  if (seen.has(event.id)) return // webhook-id = event.id: deduplicate
  seen.add(event.id)
  if (event.type === 'video.ready') console.log('ready', event.data.object.id)
})
app.listen(3000)
Python
# Flask: request.get_data() is the raw body
import base64, hashlib, hmac, json, os, time
from flask import Flask, request

def verify_flow_webhook(secret: str, headers, raw_body: bytes) -> bool:
    msg_id = headers.get("webhook-id", "")
    ts = headers.get("webhook-timestamp", "")
    sig_header = headers.get("webhook-signature", "")
    try:
        t = int(ts)
    except ValueError:
        return False
    if not msg_id or abs(int(time.time()) - t) > 300:  # older than 5 minutes
        return False
    key = base64.b64decode(secret[6:] if secret.startswith("whsec_") else secret)
    signed = msg_id.encode() + b"." + ts.encode() + b"." + raw_body
    expected = "v1," + base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    # during a secret rotation the header carries two signatures, separated by a space
    return any(hmac.compare_digest(s, expected) for s in sig_header.split(" ") if s)

app = Flask(__name__)
seen = set()  # use a database in production

@app.post("/flow-webhook")
def flow_webhook():
    raw = request.get_data()
    if not verify_flow_webhook(os.environ["FLOW_WEBHOOK_SECRET"], request.headers, raw):
        return "", 400
    event = json.loads(raw)
    if event["id"] in seen:  # webhook-id = event id: deduplicate
        return "", 200
    seen.add(event["id"])
    if event["type"] == "video.ready":
        print("ready", event["data"]["object"]["id"])
    return "", 200

Warning: Answer 2xx only after verifying. Answer a message without a valid signature or with an old timestamp with 400 and do not process it.

Delivery, timeout and retries

  • Answer within 10 seconds with a status from 200 to 299. The response body is ignored; the log keeps its first 500 characters.
  • Redirects (3xx) are not followed and count as a failure.
  • Any other answer, a timeout or a connection error leads to a retry: after 1, 5, 15, 60, 120, 240, 480 and 480 minutes – 8 retries over about 23.4 hours. After that the delivery is failed.
  • Sending runs every minute. So up to about one minute can pass between the event and the first delivery.
  • Paused webhooks (enabled: false) receive no new events. Retries already scheduled wait and continue once you switch it on again.
  • Order is not guaranteed. Decide by data.object.status and created, not by arrival.
  • The same event can arrive more than once (retry, send again). Deduplicate by webhook-id.
  • File links in the body are valid 24 hours from the event. If a retry arrives late, fetch fresh links with GET /renders/{id}.
  • Finished deliveries (delivered or given up) stay in the log for 30 days.

Note: Unlike the OpenAPI description says, there is currently no random jitter on retries, no e-mail when a delivery is given up, no automatic pause after three days of failures and no GET /events endpoint.

Allowed addresses

If a URL breaks these rules, POST and PATCH answer 422 webhook_url_not_allowed. If a name later points to a private network, the delivery fails (log: “Ziel-Adresse gesperrt”, target address blocked).

  • Only https://, port 443 or no port.
  • No credentials in the URL (user:pass@).
  • No internal names: localhost, names without a dot and endings like .local, .internal, .lan, .home, .intern, .localhost.
  • No private or reserved IP addresses. The name is resolved and checked again before every send; the connection goes to exactly the checked address.

Test, log, send again, change the secret

POST /webhooks/{id}/test sends a test.ping right away and returns the delivery with status code and response excerpt. The call counts as expensive for rate limiting, and so does retry.

GET /webhooks/{id}/deliveries lists deliveries with status (pending, delivered, failed), attempts, next_attempt_at, last_status_code, last_response_excerpt and last_duration_ms. retry resets one delivery and sends it at once.

rotate_secret creates a new secret (secret in the answer) and states in previous_secret_valid_until until when the old one still signs: for 24 hours every delivery carries two signatures. Switch your server over in that time.

curl
# send a test.ping now
curl -X POST https://flow-marketing.org/api/turbo/v1/webhooks/wh_3fGh7JkL9zXc1VbN5mQw/test \
  -H "Authorization: Bearer $FLOW_API_KEY"

# delivery log (newest first)
curl "https://flow-marketing.org/api/turbo/v1/webhooks/wh_3fGh7JkL9zXc1VbN5mQw/deliveries?limit=20" \
  -H "Authorization: Bearer $FLOW_API_KEY"

# send one delivery again
curl -X POST https://flow-marketing.org/api/turbo/v1/webhooks/wh_3fGh7JkL9zXc1VbN5mQw/deliveries/whd_1aS3dF5gH7jK9lZ1xC3v/retry \
  -H "Authorization: Bearer $FLOW_API_KEY"

# new secret – the old one keeps signing for 24 h
curl -X POST https://flow-marketing.org/api/turbo/v1/webhooks/wh_3fGh7JkL9zXc1VbN5mQw/rotate_secret \
  -H "Authorization: Bearer $FLOW_API_KEY"

# pause / resume
curl -X PATCH https://flow-marketing.org/api/turbo/v1/webhooks/wh_3fGh7JkL9zXc1VbN5mQw \
  -H "Authorization: Bearer $FLOW_API_KEY" -H "Content-Type: application/json" \
  -d '{"enabled": false}'
JavaScript
const BASE = 'https://flow-marketing.org/api/turbo/v1/webhooks/' + webhookId
const H = { Authorization: 'Bearer ' + process.env.FLOW_API_KEY, 'Content-Type': 'application/json' }

const ping = await (await fetch(BASE + '/test', { method: 'POST', headers: H })).json()
console.log(ping.status, ping.last_status_code, ping.last_response_excerpt)

const log = await (await fetch(BASE + '/deliveries?limit=20', { headers: H })).json()
for (const d of log.data.filter((x) => x.status === 'failed')) {
  await fetch(BASE + '/deliveries/' + d.id + '/retry', { method: 'POST', headers: H })
}

const rot = await (await fetch(BASE + '/rotate_secret', { method: 'POST', headers: H })).json()
console.log(rot.secret, rot.previous_secret_valid_until)
Python
import os, requests

BASE = "https://flow-marketing.org/api/turbo/v1/webhooks/" + webhook_id
H = {"Authorization": "Bearer " + os.environ["FLOW_API_KEY"]}

ping = requests.post(BASE + "/test", headers=H, timeout=30).json()
print(ping["status"], ping["last_status_code"], ping["last_response_excerpt"])

log = requests.get(BASE + "/deliveries", params={"limit": 20}, headers=H, timeout=30).json()
for d in log["data"]:
    if d["status"] == "failed":
        requests.post(BASE + "/deliveries/" + d["id"] + "/retry", headers=H, timeout=30)

rot = requests.post(BASE + "/rotate_secret", headers=H, timeout=30).json()
print(rot["secret"], rot["previous_secret_valid_until"])
Delivery
{
  "id": "whd_1aS3dF5gH7jK9lZ1xC3v",
  "object": "delivery",
  "webhook_id": "wh_3fGh7JkL9zXc1VbN5mQw",
  "event_id": "evt_5pN2kLm8QwRt6Yu1Io3P",
  "event_type": "video.ready",
  "status": "pending",
  "attempts": 2,
  "next_attempt_at": "2026-11-22T09:21:00.000Z",
  "last_status_code": 503,
  "last_response_excerpt": "Service Unavailable",
  "last_duration_ms": 412,
  "delivered_at": null,
  "created_at": "2026-11-22T09:00:00.000Z"
}

The webhook object

FieldMeaning
idwh_ plus 20 characters
url, events, descriptionas created
modetest or live
enabledfalse = paused
paused_reasonmanual when enabled: false, otherwise null
success_rate_24halways null today
created_attimestamp (ISO 8601, UTC)
secretonly in the answer to create and rotate

Did this help?

Still have a question?

Mo is an AI and answers right away from these articles. A person on our team replies within 24 hours on business days.

Some services degraded
Create a videoNo subscription needed · cancel any time