DocsStay organised
Webhooks
Payloads, events and how to verify the signature.
3 min readStay organised
A webhook channel sends a JSON POST to your HTTPS endpoint. Use it to connect Zapier, Make, n8n or your own code.
Events
| X-Workup-Event | Sent when |
|---|---|
job.matched | An alert matched a listing (alert, job and match summary) |
jobs.digest | A daily digest is due |
pipeline.reminder | A reminder on a tracked job is due |
test | You pressed Send test |
Verifying the signature
Every request carries X-Workup-Signature: t=<unix seconds>,v1=<hex>. v1 is the HMAC-SHA256 of <t>.<raw body> using your channel's secret.
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(header, rawBody, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}Important
Compute the HMAC over the raw body before parsing it, and reject requests older than a few minutes to prevent replays.
Something missing or wrong on this page?Tell us