leave.updated webhook: a leave was changed
Use this event to react when an open or approved leave is edited — for example when its dates, times, leave type or reason change. The webhook owner needs leaves:read. The delivery is a POST with an application/json body; a successful acknowledgement is any 2XX response.
When this event applies — and when it does not
Subscribe only if your integration needs to react to edits rather than to lifecycle transitions. leave.updated covers changes to a leave that remains open or approved; it is distinct from leave.added, where an already approved leave is created or auto-approved, and from leave.approved, where an approver, location admin or admin approves a pending request. If you only need approval outcomes, handling leave.approved and leave.denied may be sufficient and less noisy.
Headers to check on every delivery
Every delivery carries VT-Signature, VT-Webhook-Id, VT-Event-Id, VT-Event-Type, VT-Delivery-Id, VT-Delivery-Attempt and User-Agent. VT-Event-Id equals the body id; VT-Event-Type equals the body type. Use VT-Event-Id for duplicate detection because the same change always produces the same ID. Use VT-Delivery-Id to group retries of one delivery and VT-Delivery-Attempt to see how many times it has been tried. See the header definitions below.
Reading the request body
The JSON body is a LeaveWebhookEvent with id, type, apiVersion, createdAt, companyId, data and optional apiClient. apiVersion is 2 and createdAt is an ISO 8601 date-time. Inside data, expect the leave fields returned by the matching GET endpoint: userId, status, startDate and endDate in YYYY-MM-DD form, durationCalendarDays and durationWorkingDays, isFullDayLeave with optional start and end hour and minute for part-day leave, leaveTypeId, locationId and departmentId captured at request time, approvedLevel, and timestamps. approverId and autoApproved are optional. See the request body fields below.
Scope and expansion traps
Two scope traps cause most integration bugs. First, reason and statusReason are null unless the owner also has leaves:read-reason; an empty string means no reason was given, while null can mean the scope is missing. Second, expanded objects are conditional: user, approver, leaveType, location, department and holidays appear only when expand requests them, so code must tolerate their absence. apiClient appears only for API-originated changes and identifies the key that made the change.
Handler checklist with an example
A practical handler checklist: verify the signature over the raw body before parsing; reject unknown event types; store VT-Event-Id before processing so a retry after a crash does not double-apply; treat VT-Delivery-Attempt above 1 as a retry and make processing idempotent; update your local leave record from data rather than merging partial fields; and return a 2XX response only after the update is durably stored. Example: if a user moves an approved leave from Friday to Monday, data.startDate and data.endDate change while status stays APPROVED — your calendar sync should move the block instead of creating a second one.
| Signal | What it tells you | Action |
|---|---|---|
| VT-Event-Id / body id | Deterministic ID for this change | Deduplicate processed events |
| VT-Delivery-Id | Same across retries of one delivery | Group retry attempts |
| VT-Delivery-Attempt | Starts at 1, increments per retry | Alert on repeated failures |
| VT-Signature | HMAC over timestamp and raw body | Verify before processing |
| data.status | OPEN or APPROVED for this event | Update local leave state |
Headers are defined in protected modules schema0001-schema0006; body fields in schema0008.
Frequently asked questions
When is leave.updated sent?
This event fires after an existing leave that is still open or already approved is edited. Typical edits include shifting dates or times, switching leave type, or changing the reason given. The webhook owner needs leaves:read.
How do I handle duplicates and retries safely?
Check the delivery headers first: VT-Event-Id matches the body id and is deterministic for the same change, so store processed event IDs to skip duplicates. VT-Delivery-Id stays the same across retries of one delivery, while VT-Delivery-Attempt starts at 1 and increases. Verify VT-Signature before trusting the payload, and note that for 24 hours after a secret rotation a second v1 entry signed with the previous secret may be present.
What should I read in the payload?
The data object mirrors the matching GET leave shape, including status, dates, durations, leave type, location and department captured when the request was sent, and approval level. Reason fields are null without leaves:read-reason scope. Optional expanded objects such as user, approver, leaveType, location, department and holidays appear only when requested via expand. apiClient is present only when the change came through the API.
VT-Signature
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Signature | string | Yes | t= ,v1= . "> . For 24 hours after a secret rotation it carries a second v1 entry signed with the previous secret. See Signature verification at the top of this document. |
VT-Webhook-Id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Webhook-Id | string | Yes | the ID of the webhook the delivery is for. |
VT-Event-Id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Event-Id | string | Yes | the event ID, the same as id in the body. Use it to skip duplicate deliveries. |
VT-Event-Type
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Event-Type | string | Yes | the event type, the same as type in the body. | Allowed values: $3b |
VT-Delivery-Id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Delivery-Id | string | Yes | the delivery ID, unique per delivery and kept across retries of the same delivery. |
VT-Delivery-Attempt
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| VT-Delivery-Attempt | integer | Yes | the attempt number of this delivery, starting at 1. | 1 <= value |