Skip to content

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.

Receiver checklist for leave.cancelled
CheckWhat to confirmWhy it matters
SignatureVT-Signature validates over timestamp plus raw bodyRejects forged or tampered deliveries
Event identityVT-Event-Id equals body id; type equals leave.cancelledEnables safe deduplication and routing
Delivery trackingVT-Delivery-Id stable across retries; VT-Delivery-Attempt starts at 1Distinguishes retries from new events
ScopeOwner has leaves:read; leaves:read-reason for reason textPrevents null reason surprises
Payload statusdata.status is CANCELLEDCross-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

FieldTypeRequiredDescriptionConstraints
VT-SignaturestringYest= ,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

FieldTypeRequiredDescriptionConstraints
VT-Webhook-IdstringYesthe ID of the webhook the delivery is for.

VT-Event-Id

FieldTypeRequiredDescriptionConstraints
VT-Event-IdstringYesthe event ID, the same as id in the body. Use it to skip duplicate deliveries.

VT-Event-Type

FieldTypeRequiredDescriptionConstraints
VT-Event-TypestringYesthe event type, the same as type in the body.Allowed values: $3b

VT-Delivery-Id

FieldTypeRequiredDescriptionConstraints
VT-Delivery-IdstringYesthe delivery ID, unique per delivery and kept across retries of the same delivery.

VT-Delivery-Attempt

FieldTypeRequiredDescriptionConstraints
VT-Delivery-AttemptintegerYesthe attempt number of this delivery, starting at 1.1 <= value