Webhooks
For production systems, webhooks are the better choice. Instead of polling, you register a URL and VideoGen sends you an event when work completes. For the full list of event types and payload schemas, see the Webhook events reference.
1. Register a webhook endpoint
The response includes a signingSecret. Save it; you’ll need it to verify incoming requests.
2. Handle incoming events
When an execution reaches a terminal status, VideoGen sends a POST request to your URL:
Each entry in results contains the file id, type, and a hydrated file object with signed download URLs, so no extra API call is needed. For tool_execution.failed and tool_execution.cancelled events, results is absent.
3. Verify signatures
Webhook deliveries follow the Standard Webhooks spec. Both SDKs ship a verifyWebhookSignature helper so you can confirm a request is authentic without pulling in the standardwebhooks library yourself:
TypeScript
Python
Manual
The helpers throw if the signature is invalid or the timestamp is too old, so catch the error to reject the request.
File upload webhooks
In addition to tool execution events, you can subscribe to file upload lifecycle events. These are only fired for files uploaded via the API (not the VideoGen UI).
Register for file events the same way as tool events:
Next steps
- Webhook events reference — full list of event types and payload schemas
- Webhook management API — create, list, and delete webhook endpoints programmatically