Leave policy disabled webhook event
Use this event to react when a leave type is switched off for a location. The webhook owner needs the leave-policies:read scope, and the payload identifies the affected policy, including its location and leave type.
When this event fires
This webhook fires when a leave type is disabled for a location. It is the counterpart to the enabled-or-changed event: for this event, the data object contains the policy with isActive set to false, so your handler can confirm the change from the payload itself instead of inferring it from the event name alone.
Headers to verify and track
Checklist for a safe handler:
- Verify the VT-Signature header against the raw body before trusting any field.
- Read VT-Event-Type to confirm leave-policy.disabled, and compare it with the type field in the body.
- Store the event ID from VT-Event-Id, which matches id in the body, and skip any ID already processed.
- Track VT-Delivery-Id and VT-Delivery-Attempt separately: the delivery ID is stable across retries, while the attempt number starts at 1.
- Confirm VT-Webhook-Id identifies the webhook this delivery belongs to.
- Expect the User-Agent header on every delivery.
Request body
The request body is JSON. Its top-level fields are id, type, apiVersion, createdAt, companyId and data, with apiClient present only when the change was made through the API. The id is deterministic for the same change, which is what makes duplicate detection reliable; test events are the exception and receive a random ID. The type field for this page is limited to leave-policy.enabled or leave-policy.disabled, and apiVersion is "2".
Reading the policy payload
Inside data, use locationId and leaveTypeId to identify exactly which policy was switched off. The remaining fields describe that policy as the matching GET endpoint returns it, including quota unit and yearly amounts, rollover limits, approval and reason requirements, visibility, past-date and negative-balance rules, the shortest requestable interval, accrual settings, brought-forward expiration and TOIL settings. Optional fields such as hoursPerYear, maxRolloverHours and parts of the accrual, expiration and TOIL objects may be absent when not set, so treat them as optional rather than assuming a fixed shape.
Worked example
A practical example: a location disables a leave type, and your system receives the event. First verify the signature, then check that the event type is leave-policy.disabled. Look up the policy by its locationId and leaveTypeId, confirm isActive is false, and only then update your local availability rules. If the same event ID arrives again on a retry, skip it without applying the change twice. If apiClient is present, it identifies the API key that made the change; if it is absent, the change was not made through the API.
Frequently asked questions
What does the leave-policy.disabled webhook mean?
This event is delivered when a leave type stops applying to a location. The webhook owner needs the leave-policies:read scope. In the payload, data carries the affected policy with isActive set to false, which distinguishes it from an enabled or changed policy.
How should duplicate deliveries be handled?
Verify the signature using the raw request body, then use the event ID to skip duplicates. The delivery ID stays the same across retries of one delivery, while the attempt number starts at 1 and increases, so deduplication should be based on the event ID rather than treating every retry as a new change.
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 |