Webhooks

Webhooks

Signed webhooks (HMAC-SHA256). Beta

Register an endpoint under Settings › Security › Webhooks, or with POST /webhooks in the Webhooks API, and choose the events you want from the event catalogue (39 events). The signing secret is shown once, when you create the endpoint. Each event arrives as a POST with a JSON body.

What each delivery carries

  • X-HCM-Event: the event name.
  • X-HCM-Delivery-Id: the same on every retry of one delivery. Store it and ignore a repeat.
  • X-HCM-Signature: t=<unix seconds>,v1=<hex>: an HMAC-SHA256 of <t>.<raw body>, keyed with the endpoint’s signing secret.

Verifying the signature

Check the signature against the raw body bytes before you parse the JSON, compare in constant time, and refuse a timestamp more than five minutes from your own clock. That stops both forged and replayed deliveries.

Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the request body exactly as received (string or Buffer) — verify BEFORE JSON.parse.
export function verifyHcmSignature(rawBody, signatureHeader, secret, toleranceSec = 300) {
  const match = /^t=(\d+),v1=([0-9a-f]+)$/i.exec(signatureHeader ?? "");
  if (!match) return false;
  const t = Number(match[1]);
  if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false; // replay window
  const expected = createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest();
  const given = Buffer.from(match[2], "hex");
  return given.length === expected.length && timingSafeEqual(given, expected);
}
Python
import hashlib
import hmac
import re
import time

def verify_hcm_signature(raw_body: bytes, signature_header: str, secret: str, tolerance: int = 300) -> bool:
    """raw_body: the request body bytes exactly as received — verify before json.loads."""
    match = re.fullmatch(r"t=(\d+),v1=([0-9a-fA-F]+)", signature_header or "")
    if not match:
        return False
    t = int(match.group(1))
    if abs(time.time() - t) > tolerance:  # replay window
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, match.group(2).lower())
curl: send yourself a signed test delivery
# Send yourself a correctly signed test delivery (bash + openssl).
SECRET='<your endpoint signing secret>'
BODY='{"employeeId":"00000000-0000-0000-0000-000000000000"}'
T=$(date +%s)
SIG=$(printf '%s.%s' "$T" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')

curl -X POST 'https://your-receiver.example.com/hcm-webhooks' \
  -H 'Content-Type: application/json' \
  -H 'X-HCM-Event: employee.created' \
  -H "X-HCM-Delivery-Id: $(uuidgen)" \
  -H "X-HCM-Signature: t=$T,v1=$SIG" \
  --data "$BODY"

Retries

Answer with any 2xx within 10 seconds. Anything else, or no answer, is retried after 1 minute, 15 minutes, 1 hour, 3 hours and 6 hours. An endpoint that fails 100 deliveries in a row is switched off and a workspace admin is told.

Endpoint addresses

Webhook destinations are checked to block server-side request forgery. Beta

A sandbox workspace never sends webhooks, so you can’t register an endpoint there. Test your receiver with the signed curl example above.

Using Zapier or Make

Connect Zapier or Make through webhooks and the API. Beta

There’s nothing to install. Catch the delivery with their webhook trigger, check X-HCM-Signature in a code step before doing anything else, and call the API with a key that has only the scopes the automation needs.