Webhooks
Receive real-time notifications when video generations complete. Set up endpoints via the Svix portal, understand event types, payload schemas, and retry behavior.
Pipevideo uses Svix to deliver webhooks when video generations complete. Configure your endpoints in the Svix portal, then receive video.generation.completed events with generation status and output URLs.
Setup via Svix portal
- Sign in to the Pipevideo dashboard (or http://localhost:3000 for local development).
- Select your organization.
- Go to Webhooks in the sidebar (or navigate to
/webhooks). - The Svix app portal opens in an iframe. Use it to:
- Add endpoint — Enter your webhook URL (e.g.
https://your-app.com/api/webhooks/pipevideo). - Subscribe to events — Enable
video.generation.completed. - Copy signing secret — Use it to verify webhook signatures (see Verifying signatures).
- Add endpoint — Enter your webhook URL (e.g.
Webhooks are scoped per organization. Each organization has its own Svix application and endpoints.
Event types
| Event type | Description |
|---|---|
video.generation.completed | Fired when a video generation finishes, whether it succeeded or failed. |
This event is sent for both successful completions and failures (e.g. credit reservation failure, provider timeout, or generation error). Use the status field in the payload to distinguish outcomes.
Payload schema
Each webhook payload is a JSON object with the following fields:
| Field | Type | Description |
|---|---|---|
eventType | string | Always "video.generation.completed". |
generationId | string | The Pipevideo generation ID (e.g. gen_abc123xyz). Use this to correlate with your POST /v1/video/generations response. |
status | "completed" | "failed" | Whether the generation succeeded or failed. |
outputUrl | string | null | When status is "completed", the URL to download the generated video. Omitted or null when failed. |
errorMessage | string | null | When status is "failed", a human-readable error message. Omitted or null when completed. |
Example: completed generation
{
"eventType": "video.generation.completed",
"generationId": "gen_abc123xyz",
"status": "completed",
"outputUrl": "https://storage.example.com/videos/abc123.mp4"
}Example: failed generation
{
"eventType": "video.generation.completed",
"generationId": "gen_abc123xyz",
"status": "failed",
"errorMessage": "Provider callback timed out"
}Verifying signatures
Svix signs each webhook with an HMAC. Verify the request before processing it to ensure it came from Pipevideo.
Svix sends these headers:
svix-id— Unique message IDsvix-timestamp— Unix timestamp (seconds)svix-signature— Signature (format:v1,signature)
Use your endpoint's signing secret from the Svix portal. Example verification (Node.js with the svix package):
import { Webhook } from "svix";
const wh = new Webhook(process.env.PIPEVIDEO_WEBHOOK_SECRET);
const payload = await req.text();
const headers = {
"svix-id": req.headers.get("svix-id"),
"svix-timestamp": req.headers.get("svix-timestamp"),
"svix-signature": req.headers.get("svix-signature"),
};
const body = wh.verify(payload, headers);
// body is the parsed JSON payloadReject requests with invalid or missing signatures (return 401 Unauthorized).
Retry behavior
Svix retries failed deliveries using an exponential backoff schedule. Your endpoint should return a 2xx status within 15 seconds for the delivery to be considered successful.
Retry schedule
| Attempt | Delay after previous failure |
|---|---|
| 1 | 5 seconds |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 5 hours |
| 6 | 10 hours |
| 7 | 10 hours |
| 8 | Immediately (final attempt) |
Success criteria
- Success: Your endpoint returns any
2xxstatus (200–299) within 15 seconds. - Failure: Any other response (including
3xxredirects), timeout, or connection error triggers a retry.
After retries exhausted
When all retries fail, Svix marks the message as Failed and sends an operational webhook (message.attempt.exhausted) to notify you. Endpoints that fail repeatedly over 5 days (with multiple failures within 24 hours) may be automatically disabled.
Best practices
- Respond quickly — Process the webhook asynchronously if needed; return
200immediately and handle the payload in a background job. - Be idempotent — The same event may be delivered more than once; use
generationIdto deduplicate. - Return 2xx only on success — Return
500or another non-2xx if you cannot process the payload, so Svix will retry.
Next steps
- Quickstart — Submit your first video generation.
- Models — Browse available models and pricing.