Webhooks are how you avoid polling. When a render reaches a terminal state —Documentation Index
Fetch the complete documentation index at: https://docs.kodisc.com/llms.txt
Use this file to discover all available pages before exploring further.
completed or failed — Kodisc POSTs a signed JSON payload to a URL you control.
When webhooks fire
A delivery is attempted exactly once per terminal state transition for jobs that have awebhookUrl. Two ways to set one:
- Default for the key: configure a
webhookUrlon the API key in the developer dashboard. Every job enqueued with that key inherits it. - Per request: pass
webhookUrlin the body ofPOST /api/v2/renderto override the key’s default for that single job. Passnullto opt the job out of webhooks entirely.
Payload
The body is JSON. Field shapes mirror theGET /api/v2/render/{jobId} response.
status is "failed", result is null, and error carries a human-readable message.
Headers
Each delivery includes:| Header | Value |
|---|---|
content-type | application/json |
kodisc-event | completed or failed |
kodisc-signature | t=<unix-seconds>,v1=<hex hmac> — see below |
Verifying signatures
The signature lives inkodisc-signature and looks like t=1714326842,v1=4f8a…. To verify:
- Split the header on
,and parse outt(timestamp) andv1(HMAC). - Build the signed string as
${t}.${rawBody}— the literal request body, byte-for-byte, before any JSON parsing. - Compute
HMAC-SHA256(signed_string, webhook_secret)and hex-encode it. - Compare against
v1using a constant-time equality check.
Retries
Kodisc treats a delivery as successful when your endpoint returns a2xx within 10 seconds. Otherwise, it retries up to 3 more times with these delays from the original attempt:
| Attempt | Delay before sending |
|---|---|
| 1 | immediate |
| 2 | 30 seconds |
| 3 | 5 minutes |
| 4 | 30 minutes |
0 if the request never connected) and number of attempts are visible in the dashboard, so you can replay manually if needed.
Design your handler to be idempotent — even though Kodisc doesn’t intentionally double-deliver, network edges happen. Treat jobId as the dedupe key.
Recommended response
Return2xx as soon as you’ve persisted the event. Do the heavy work (downloading the video, updating your DB, notifying users) asynchronously. Slow handlers eat into your 10-second window and can trigger spurious retries.
Testing locally
Kodisc requires webhook URLs to start withhttps://, and deliveries are made from Kodisc’s servers — so http://localhost won’t work. The solution is a tunnel: a tool that gives your local server a public HTTPS URL that Kodisc can reach.
Option 1: ngrok
The most widely used option. Install ngrok, then run:https://abc123.ngrok-free.app. Use that as your webhook URL when calling the API or configuring your key.
Option 2: Cloudflare Tunnel
No account required for quick tunnels. Install cloudflared, then run:https:// URL you can use immediately.
Option 3: VS Code port forwarding
If you’re using VS Code with a GitHub account, open the Ports panel, right-click your local port, and select Make Public. VS Code copies anhttps:// forwarding URL to your clipboard.
Once your tunnel is running, pass its URL as
webhookUrl in your render request: