Docs › Webhooks
Webhooks
Get notified when videos finish or fail, and when you're approaching your plan's limits. Set up a webhook endpoint (URL) in the web app on your Account → Webhooks page, or with the API:
GET /webhook— your current configuration.PUT /webhook {url, events?, enabled?}— save or update an endpoint.DELETE /webhook— remove the endpoint.POST /webhook/rotate— generate a new signing secret (keep the URL).POST /webhook/test— send a test event and report the result immediately.GET /webhook/deliveries— the last 30 days of delivery attempts.
Events
Each account has one endpoint that receives events for all types it's subscribed to. The possible events are:
| Event | Sent when | Data |
|---|---|---|
video.ready | The video is published and plays. This is sent as soon as it is published, before captions are made. | videoId, fileName, statusPath, metadata (if set), durationSeconds, downloadUrl (valid 1 hour), downloadExpiresInSeconds, posterUrl, playbackUrl, posterPlaybackUrl and playbackExpiresAt (locked to your allowed domains), streamUrl and streamExpiresAt if streaming, captions ({"status": "processing"}) only if the video is being made with captions, and status. |
captions.ready | The captions of a video made with captions are done. | videoId, fileName, statusPath, metadata (if set), and captions: status (ready), language, and vttUrl, srtUrl, txtUrl (valid 1 hour). |
captions.failed | The captions could not be made, or were skipped (for example a video over 4 hours, or the daily captions limit). The video itself is unaffected. | videoId, fileName, statusPath, metadata (if set), and captions: status (failed or skipped) and reason. |
video.needs_review | A review run (autoRedact with review) has looked and stopped: the video waits as NEEDS_REVIEW for a reprocess with the regions to apply. Not sent to webhooks saved before this event existed until you add it. | videoId, fileName, statusPath, metadata (if set), status NEEDS_REVIEW, and review: types, style, found, regions (counts; the regions themselves come from status). |
video.secrets_found | Auto-redaction recognised API keys or tokens on screen (keys in a format it knows), so you can rotate them. Sent once per video: as soon as it is published with them hidden, or when a review run stops with them proposed. Not sent when it recognised none, when processing failed, or to webhooks saved before this event existed until you add it. | videoId, fileName, statusPath, metadata (if set), status (SUCCEEDED or NEEDS_REVIEW), hidden (true: published with them hidden; false: a review run, nothing is hidden or published yet), and secrets: each key's type, name, lastFour, start, end and appearances. Never the key itself. |
video.failed | Processing failed or timed out. | videoId, fileName, statusPath, metadata, status: FAILED or TIMED_OUT. |
video.canceled | Processing was aborted. | videoId, fileName, statusPath, metadata. |
video.deleted | A video was deleted. | videoId, fileName, statusPath, metadata. |
usage.threshold | 80% or 100% of your plan's monthly limits is reached (once each per month). | measure (minutes, storage or delivery), percent (80 or 100), used, included (plan's allowance), month (YYYY-MM), plan (your plan name), overage (whether you'll be billed for excess). |
Order and delivery. video.ready no longer waits for captions: use it to show or publish the video, and use captions.ready or captions.failed to know when the captions are available. Each of the three is sent once per video, but the events are separate deliveries and can arrive in any order, so check captions.status and the video's state rather than relying on order. Deliveries are at-least-once: deduplicate on webhook-id.
Captions events are opt-in for existing webhooks. A webhook saved before they existed keeps exactly the events it already chose; add captions.ready and captions.failed to its events (Account → Webhooks, or PUT /webhook) to receive them. New webhooks get every event unless you choose.
Webhook envelope
Every event arrives as JSON with metadata about the event:
{
"id": "evt_a1b2c3d4e5f6g7h8",
"type": "video.ready",
"livemode": true,
"createdAt": "2025-01-15T14:30:45Z",
"data": { event-specific data }
}
livemode is false for events about test-mode videos, which arrive at the same endpoint.
Signature verification (Standard Webhooks)
Each delivery includes headers webhook-id, webhook-timestamp and webhook-signature that implement the Standard Webhooks specification, so libraries for any language can verify them:
// npm install standardwebhooks
import { Webhook } from "standardwebhooks";
const wh = new Webhook(webhookSecret); // your secret from the account page
try {
const payload = wh.verify(body, {
"webhook-id": req.headers["webhook-id"],
"webhook-timestamp": req.headers["webhook-timestamp"],
"webhook-signature": req.headers["webhook-signature"],
});
// payload is the parsed event; proceed
} catch (err) {
res.status(401).send("Unauthorized");
}
# pip install svix
from svix.webhooks import Webhook
wh = Webhook(webhook_secret) # your secret from the account page
try:
payload = wh.verify(body, {
"webhook-id": headers["webhook-id"],
"webhook-timestamp": headers["webhook-timestamp"],
"webhook-signature": headers["webhook-signature"],
})
# payload is the parsed event; proceed
except Exception as e:
return {"error": "Unauthorized"}, 401
// Manual verification (no library needed)
import crypto from "crypto";
const id = req.headers["webhook-id"];
const timestamp = req.headers["webhook-timestamp"];
const signature = req.headers["webhook-signature"];
const body = /* raw request body as string */;
// Extract the base64 part of the secret (after "whsec_")
const secretBytes = Buffer.from(webhookSecret.slice(6), "base64");
// Sign: HMAC-SHA256 of "id.timestamp.body"
const signed = crypto
.createHmac("sha256", secretBytes)
.update(`${id}.${timestamp}.${body}`)
.digest("base64");
// Refuse old deliveries, so a captured request can't be replayed later
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) <= 5 * 60;
// The header is "v1,<signature>" (possibly several, separated by spaces).
// Compare in constant time, so the check doesn't leak how much matched.
const expected = Buffer.from(signed);
const valid = fresh && signature.split(" ").some((entry) => {
const [version, value = ""] = entry.split(",");
const given = Buffer.from(value);
return version === "v1" && given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
if (!valid) {
res.status(401).send("Unauthorized");
} else {
// Valid; parse and process the event
}
Reliability and delivery
- Respond 2xx within 10 seconds. Your endpoint must be HTTPS and reachable from the public internet. Redirects (3xx) are not followed.
- Retry policy: if you don't answer 2xx or timeout, delivery is retried after 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours and 12 hours (8 attempts over ~22 hours).
- At-least-once delivery: events may arrive more than once. Deduplicate using the
webhook-idheader (unique per event). Events may arrive out of order; use timestamps if order matters. - Delivery log: check
GET /webhook/deliveriesto see recent attempts, their status codes, response bodies and errors (kept for 30 days).
URL safety
Webhook URLs must be HTTPS and resolve only to public internet addresses. Private addresses (like 10.0.0.1, 192.168.1.x, 127.0.0.1, localhost or cloud-internal networks) are rejected when you save the URL or on every delivery attempt. This protects you from SSRF attacks. Redirects are never followed; the URL you set is the URL we connect to.