Handling the leave.cancelled Webhook Event
When a leave is cancelled — by the employee or by their manager — your integration receives a leave.cancelled delivery.
When this event is useful
Subscribe only if you need to react to cancellations in near real time — for example, releasing a calendar hold, notifying a team channel, or reconciling a downstream HR record. The webhook owner must hold leaves:read. If your handler also needs to display why the leave was cancelled, request leaves:read-reason as well; without it, reason and statusReason arrive as null.
Verify the delivery before processing it
Verify VT-Signature before trusting any field: it carries a timestamp and an HMAC-SHA256 signature over the timestamp plus raw body. During the 24 hours after a secret rotation a second signature entry signed with the previous secret may be present, so accept either during that window. Then read VT-Webhook-Id to know which subscription this delivery belongs to, VT-Event-Id to deduplicate, and VT-Event-Type to confirm leave.cancelled. Track VT-Delivery-Id and VT-Delivery-Attempt to distinguish a retry of the same delivery from a new event. The full header contract is in protected modules schema0001 through schema0007.
Reading the payload
The JSON body is a LeaveWebhookEvent with apiVersion 2. Its id matches VT-Event-Id and is deterministic for the same change, which makes it the safest deduplication key. createdAt is an ISO 8601 timestamp, companyId identifies the company, and data contains the affected leave in the same shape as the matching GET endpoint. apiClient is present only when the change was made through the API. The complete body contract is protected module schema0008.
What the cancelled leave contains
Inside data, use id and userId to locate the record, startDate and endDate (YYYY-MM-DD) plus durationCalendarDays and durationWorkingDays to understand what was released, and status to confirm CANCELLED. For part-day leaves, isFullDayLeave is false and startHour, endHour, startMinute and endMinute are present in the user's time zone. leaveTypeId, locationId and departmentId capture the context at request time. Optional expanded objects — user, approver, leaveType — appear only when expand requested them, so code defensively for their absence. A practical check: if data.status is not CANCELLED, log a mismatch rather than applying the cancellation, because the event type and status should agree.
Responding and avoiding double-processing
Return a 2XX response promptly after accepting the delivery for processing; the example in the reference is grouped under 2XX. Do not wait for downstream work to finish before responding, or retries will multiply. Store VT-Event-Id on first receipt and skip any repeat with the same id, while still acknowledging it. If VT-Delivery-Attempt rises above 1, you are seeing a retry — the event id will already be known, so deduplication handles it without special casing.
| Check | What to confirm | Why it matters |
|---|---|---|
| Signature | VT-Signature validates over timestamp plus raw body | Rejects forged or tampered deliveries |
| Event identity | VT-Event-Id equals body id; type equals leave.cancelled | Enables safe deduplication and routing |
| Delivery tracking | VT-Delivery-Id stable across retries; VT-Delivery-Attempt starts at 1 | Distinguishes retries from new events |
| Scope | Owner has leaves:read; leaves:read-reason for reason text | Prevents null reason surprises |
| Payload status | data.status is CANCELLED | Cross-checks event type before applying changes |
Receiver checklist derived from the documented header and body contract in protected modules schema0001-schema0008.
Frequently asked questions
Who can trigger a leave.cancelled event?
This event fires when the leave owner cancels the request themselves, or when someone with management authority over them cancels it. It is distinct from a denial, which is an approver decision, and from a deletion, which removes the record.
How should a receiver handle duplicates and retries?
Check VT-Event-Type against the body type, verify VT-Signature over the raw body, and deduplicate on VT-Event-Id / body id. VT-Delivery-Id stays constant across retries of one delivery, while VT-Delivery-Attempt increments from 1.
What scope is required to receive this event and its reason?
The webhook owner needs leaves:read. Reason fields additionally require leaves:read-reason; without that scope the reason values are null rather than empty strings.
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 |