Webhooks
Put a webhookUrl and a list of events in your manifest. When a company installs your app, we create a signed endpoint for that installation and send events as they happen.
Events
| Event | When |
|---|---|
request.submitted / approved / rejected / cancelled | Leave, expenses, forms, equipment requests |
person.hired | A person was added |
person.offboarding | Someone's leaving was started |
booking.created / booking.cancelled | Room bookings |
Delivery
POSTwith a JSON body, following Standard Webhooks: headerswebhook-id,webhook-timestamp,webhook-signature: v1,<base64 HMAC-SHA256>.- The signature covers
id.timestamp.bodywith yourwebhook_secret(from the first token exchange). - Answer
2xxwithin 10 seconds. We retry after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h. After 20 failures in a row the endpoint is switched off and the company sees it as failing. - Deliveries only go to public
httpsaddresses, checked again at send time.
Verify a signature (Node)
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(secret, headers, rawBody) {
const id = headers["webhook-id"], ts = headers["webhook-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const mac = createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64");
return headers["webhook-signature"].split(" ").some((s) => {
const sig = s.split(",")[1] ?? "";
return sig.length === mac.length && timingSafeEqual(Buffer.from(sig), Buffer.from(mac));
});
}Use webhook-id to ignore duplicates.