How webhooks work
Polling an API to see if anything changed wastes credits and still runs late. Webhooks flip it: we send you the change the moment we see it.
- Add an endpointRegister a URL and choose which events it receives.
- Verify each deliveryCheck the
DJ-Signatureheader before trusting the body. - Return 2xx fastAcknowledge within 10 seconds, then do the work in a queue.
Events
| Event | Fires when | Dataset |
|---|---|---|
company.updated | Any firmographic field changes. Includes previous values. | Firmographics |
technology.detected | A new product is confirmed at a company. | Technographics |
technology.removed | A product stops being detected. | Technographics |
intent.surged | A tracked topic surges above the company's baseline. | Intent |
contact.changed_jobs | A contact starts at a new company. | Contacts |
contact.verified | A contact's email passes or fails verification. | Contacts |
Payload
{
"id": "evt_3x9Lq2",
"type": "company.updated",
"created_at": "2026-11-22T06:41:09Z",
"data": {
"company_id": "dj_8f2a9c",
"changes": {
"employee_count": { "previous": 398, "current": 412 },
"funding.stage": { "previous": "series_a", "current": "series_b" }
}
}
}Every event carries a unique id. Deliveries are at least once, so store the ID and skip duplicates.
Verify signatures
Each request carries DJ-Signature: t=1763793669,v1=5257a8…. Compute an HMAC of t.body with your endpoint secret and compare in constant time. Reject anything older than five minutes to stop replays.
import crypto from "node:crypto";
export function verify(rawBody: string, header: string | undefined, secret: string): boolean {
if (!header) return false;
const parts = new Map(header.split(",").map(p => p.split("=", 2) as [string, string]));
const t = Number(parts.get("t")), v1 = parts.get("v1") ?? "";
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > 300) return false; // replay window
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const a = Buffer.from(expected, "utf8"), b = Buffer.from(v1, "utf8");
return a.length === b.length && crypto.timingSafeEqual(a, b); // never throws on bad input
}import hmac, hashlib, time
def verify(raw_body: bytes, header: str | None, secret: str) -> bool:
try:
parts = dict(p.split("=", 1) for p in (header or "").split(","))
t = int(parts["t"])
except (ValueError, KeyError):
return False # malformed header: reject, don't crash
if abs(time.time() - t) > 300: # replay window
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))Retries
Any non-2xx response or a timeout after 10 seconds triggers a retry with exponential backoff, for up to 24 hours. After that the event is marked failed and can be replayed from the dashboard or POST /v1/events/{id}/replay.
Streams
For high-volume pipelines, open a Server-Sent Events stream instead of receiving HTTP calls. Streams resume from the last event ID you saw, so a deploy never drops data. Available on Pro and above.
curl -N "https://api.dstaq.co/v1/stream?types=company.updated,intent.surged" \
-H "Authorization: Bearer $DATAJUICE_KEY" \
-H "Last-Event-ID: evt_3x9Lq2"FAQ
No. Events and streams are free on every plan that includes them.
We retry with exponential backoff for up to 24 hours, then mark the event failed so you can replay it.
Yes, as with any at-least-once system. Deduplicate on the event id and use created_at for ordering.
Check the HMAC SHA-256 signature in the DJ-Signature header against your endpoint secret, and reject timestamps older than five minutes.