Generate
Webhooks
If you include webhook_url in a generation request, a notification is sent to that URL when the job finishes.
When it's sent
- generation.completed: when a job is completed
- generation.failed: when a job fails
- Not sent for canceled jobs.
Body
Sent as a POST. data contains the same job response as a job lookup.
- The request includes the headers Content-Type: application/json, User-Agent: Dropshot-Webhook/1.0, and Dropshot-Signature. Other tracing and transport headers (traceparent, accept, etc.) may also be sent, so read only the headers you need.
- There is no separate header with the event ID. Use the id in the body to detect duplicates.
- created_at is when the job finished, so it equals data.completed_at. Times are UTC with milliseconds.
{
"id": "evt_3c59dc048e8850243be8079a5c74d079",
"type": "generation.completed",
"created_at": "2026-11-17T09:01:12.345Z",
"data": {
"id": "api_8f14e45fceea167a5a36dedd4bea2543",
"status": "completed",
"model": "MODEL_ID",
"credit_cost": 150.03,
"is_refunded": false,
"created_at": "2026-11-17T09:00:00.123Z",
"completed_at": "2026-11-17T09:01:12.345Z",
"output_expires_at": "2026-11-18T09:01:12.345Z",
"is_output_expired": false,
"error": null,
"output": [
{
"type": "video",
"url": "https://...",
"poster_url": "https://...",
"width": 1280,
"height": 720,
"duration": 5.04,
"text": null
}
]
}
}Verify the signature
To filter out forged notifications, verify every delivery in this order.
- Read t and v1 from the Dropshot-Signature header (t=sent time,v1=signature). t is in Unix seconds.
- Discard it if t differs from the current time by more than 5 minutes.
- Compute HMAC-SHA256 of "t.raw body" with your whsec_ secret as hex. Use the raw body as received, before parsing JSON.
- Check that the result equals v1. Use a constant-time comparison as in the example below, not a plain string compare.
- The same notification can arrive twice, so use the body's id to skip ones you've already handled.
import crypto from 'node:crypto';
// rawBody is the request body string before JSON parsing
const verifyDropshotSignature = (rawBody, signatureHeader, secret) => {
const { t, v1 } = Object.fromEntries((signatureHeader ?? '').split(',').map((part) => part.split('=')));
if (!t || !v1) return false;
if (!(Math.abs(Date.now() / 1000 - Number(t)) <= 300)) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
return v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
};If you regenerate the secret in the console, new requests are signed with the new value right away.
Sending IPs
In production, webhooks are sent only from the IPs below. If you have a firewall, allow all of these IPs.
52.78.224.2243.36.253.115
Responses and retries
- Reply with a 2xx within 10 seconds and we'll treat it as received. Do any heavy processing after you reply.
- Redirects aren't followed and count as a failure. Use the final URL for webhook_url.
- If delivery fails, we retry after 1, 5, 15, and 30 minutes, then every 60 minutes. After 11 attempts in total, including the first, it becomes Not received.
- If webhook_url is an internal name such as localhost, .local, or .internal, an internal IP, or a name whose DNS lookup returns an internal IP, the create request is rejected with 400 invalid_request. details.parameter is webhook_url and details.reason is "Must not point to an internal address." No job is created, so no credits are deducted.
- If a public address can't be confirmed through DNS, the create request is rejected with the same 400, and reason is "Must resolve to a public address."
- If the address resolves to an internal IP when we send after the job was created, we don't connect. Retrying would give the same result, so we don't retry and it becomes Not received right away.
- Each resend gets a new t and signature, while the body's id and created_at keep their original values.
- data reflects the job's state at the time of the resend, so output is null after 24 hours from completion.
- Result URLs you receive stay open for at least 24 hours. Download anything you want to keep.
- Webhook failures don't affect results or credits. If you missed one, check with a job lookup.