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

EventWhen
request.submitted / approved / rejected / cancelledLeave, expenses, forms, equipment requests
person.hiredA person was added
person.offboardingSomeone's leaving was started
booking.created / booking.cancelledRoom bookings

Delivery

  • POST with a JSON body, following Standard Webhooks: headers webhook-id, webhook-timestamp, webhook-signature: v1,<base64 HMAC-SHA256>.
  • The signature covers id.timestamp.body with your webhook_secret (from the first token exchange).
  • Answer 2xx within 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 https addresses, 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.