Video Piper APIv1 Home OpenAPI spec

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:

EventSent whenData
video.readyThe 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.readyThe 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.failedThe 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_reviewA 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_foundAuto-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.failedProcessing failed or timed out.videoId, fileName, statusPath, metadata, status: FAILED or TIMED_OUT.
video.canceledProcessing was aborted.videoId, fileName, statusPath, metadata.
video.deletedA video was deleted.videoId, fileName, statusPath, metadata.
usage.threshold80% 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");
}

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-id header (unique per event). Events may arrive out of order; use timestamps if order matters.
  • Delivery log: check GET /webhook/deliveries to 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.