Skip to content

Webhooks

A webhook is a URL on your server that ZilloData calls when one of your background jobs finishes. Each call is signed, so you can confirm it came from us before acting on it.

Setting one up

Register an https:// URL either in the dashboard under Webhooks or with the API:

curl https://api.zillodata.com/v1/webhooks \
-H "Authorization: Bearer $ZILLODATA_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.example.com/zillodata",
"events": ["job.succeeded", "job.failed"],
"description": "Listing sync worker"
}'

Leave out events to receive all four. The response includes a secret that starts with whsec_. It is shown only once, so store it with your other secrets right away. You’ll need it to check signatures.

Webhooks apply to your whole account. Every active webhook that subscribes to an event receives it, whichever key started the job.

Events

Event Sent when
job.succeeded The job finished and its results are ready
job.failed The job stopped because of an error
job.timed_out The job ran past its time limit
job.aborted The job was stopped before finishing

What we send

The body is JSON describing the job. It does not include the result rows.

{
"event": "job.succeeded",
"delivered_at": "2026-11-03T15:42:08.117Z",
"data": {
"job": {
"id": "3f6c1b2e-8d4a-4e7b-9a10-5c2d7e8f9b01",
"type": "chained_search_detail",
"status": "succeeded",
"result_count": 142,
"created_at": "2026-11-03T15:31:50.402Z",
"started_at": "2026-11-03T15:31:51.008Z",
"completed_at": "2026-11-03T15:42:07.861Z"
}
}
}

Fetch the rows afterwards with GET /v1/jobs/{id}/results.

These headers come with every request:

POST /zillodata HTTP/1.1
Content-Type: application/json
User-Agent: zillodata/1.0
x-zd-event: job.succeeded
x-zd-signature: t=1793720528,v1=3b8f0c...e41a

Checking the signature

x-zd-signature has two parts:

  • t is the Unix time, in seconds, when we signed the request.
  • v1 is a lowercase hex HMAC-SHA256 digest. The key is your full webhook secret, including the whsec_ prefix. The message is the value of t, a period, and the raw request body: <t>.<body>.

To verify, rebuild that message from the bytes you received, compute the digest, and compare it to v1 in constant time. Reject the request if the timestamp is more than about five minutes away from your clock.

import { createHmac, timingSafeEqual } from "node:crypto";
export function isValidSignature(secret, header, rawBody) {
const match = /^t=(\d+),v1=([0-9a-f]+)$/.exec(header ?? "");
if (!match) return false;
const [, t, received] = match;
const ageSeconds = Math.abs(Date.now() / 1000 - Number(t));
if (ageSeconds > 300) return false;
const expected = createHmac("sha256", secret)
.update(`${t}.${rawBody}`)
.digest("hex");
const a = Buffer.from(received, "utf8");
const b = Buffer.from(expected, "utf8");
return a.length === b.length && timingSafeEqual(a, b);
}

Complete server examples for Express, FastAPI, and Go are in the verification recipe.

Delivery and retries

  • A delivery succeeds when your endpoint answers with any 2xx status.
  • Each attempt waits up to 8 seconds for your response.
  • A failed attempt is retried twice, so there are at most three attempts. The retries come shortly after, roughly 0.25 and 1 second later.
  • Every attempt is signed again with a fresh timestamp.
  • You can inspect recent attempts, with status codes and the start of your response body, at GET /v1/webhooks/{id}/deliveries.
  • DELETE /v1/webhooks/{id} turns a webhook off. It returns 204.

Handling events well

  • Check the signature on every request, and reject anything that fails.
  • Reply quickly. Return 200 as soon as the event is verified and do the real work in a queue, so you stay well inside the 8-second window.
  • Expect repeats. If your server times out after processing an event, the retry will deliver it again. Key your processing on data.job.id.
  • Fall back to polling for gaps. Retries end after three attempts, so if your endpoint was down, GET /v1/jobs?since=... shows anything you missed.