Overview
Webhooks let your application receive HTTP callbacks when asynchronous events happen in Quiz Quail — such as a video render completing or a YouTube upload finishing. Instead of polling for status, register a webhook URL and Quiz Quail willPOST event payloads to it in real time.
Registering a Webhook
Create a webhook by specifying a URL and the events you want to subscribe to:Managing Webhooks
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/webhooks | List all webhooks (secrets excluded) |
POST | /api/v1/webhooks | Register a new webhook |
DELETE | /api/v1/webhooks/{id} | Delete a webhook |
POST | /api/v1/webhooks/{id}/test | Send a test event |
Event Types
| Event | Description |
|---|---|
render.completed | A video render finished successfully. |
render.failed | A video render failed. |
youtube.uploaded | A video was uploaded to YouTube. |
youtube.failed | A YouTube upload failed. |
Delivery Format
When an event fires, Quiz Quail sends aPOST request to your webhook URL with these headers:
| Header | Description |
|---|---|
Content-Type | application/json |
X-QuizQuail-Event | Event name (e.g. render.completed) |
X-QuizQuail-Signature | HMAC-SHA256 signature: sha256=<hex> |
X-QuizQuail-Delivery | Unique delivery ID for idempotency |
2xx status code to acknowledge receipt.
Event Payloads
render.completed
render.failed
youtube.uploaded
youtube.failed
Verifying Signatures
Every webhook delivery is signed with your webhook secret using HMAC-SHA256. Always verify signatures to ensure the payload was sent by Quiz Quail and has not been tampered with. The signature is in theX-QuizQuail-Signature header, formatted as sha256=<hex_digest>. To verify, compute the HMAC-SHA256 of the raw request body using your webhook secret and compare it to the signature.
Node.js Example
Express.js Middleware
Testing Webhooks
Use the test endpoint to send a sample event to your webhook URL without triggering a real render or upload:Best Practices
- Respond quickly. Return a
2xxwithin 10 seconds. Offload heavy processing to a background job. - Use the delivery ID for idempotency. Store
X-QuizQuail-Deliveryvalues and skip duplicates in case of retries. - Always verify signatures. Never trust webhook payloads without verifying the HMAC signature.
- Use HTTPS endpoints. Always use
https://URLs for production webhook endpoints.