Subscriptions are managed by the
webhooks:manage scope, and re-reading records
requires employees:read.1
Subscribe to events
Create an endpoint for employee hires and deletions. The
secret in the response is
shown once — store it in a secrets manager; it verifies the signature of every
delivery.employee.changed combines creation and change: there is deliberately no separate
created. Handle the event as an upsert — the source cannot always reliably tell an
employee’s first appearance from a later change.2
Verify the signature
Every delivery carries the
Doodocs-Signature: t=<unix>,v1=<hex> header, where v1
is HMAC-SHA256(secret, "{t}.{request body}") in hex. Reject the request if the
signature does not match or t is older than five minutes (replay protection).3
Re-read and upsert
The payload contains only
employee_id. Fetch the record with your key — that way the
key’s scope and field redaction apply to the data, and personal data does not leave
for an external URL.employee.changed→ re-readGET /employees/{employee_id}and upsert byid.employee.deleted→ a re-read returns404EMPLOYEE_NOT_FOUND. Do not treat this as an error: the event is self-contained, so mark the employee deleted.
The handler
Deduplicate on the eventid (delivery is at-least-once), respond 2xx quickly, and
push the heavy work to the background.
Next
Sync all employees
Initial export and a full re-read to reconcile deletions.
Webhooks
All event types, delivery reliability, and debugging.