Leave Policy Enabled Webhook: When a Policy Is Activated or Updated
This event notifies a subscribed endpoint when a leave type becomes available for a location, or when the currently active policy for that location is modified. It is useful for synchronising quotas, approval rules, accrual settings and related controls in a connected system, rather than polling for changes.
What triggers this event
Subscribe to the leave-policy.enabled event type when you need to react to activation or modification of an active location policy. The owner requires leave-policies:read. Treat this event as distinct from leave-policy.disabled: the enabled form reports a policy that is active, while the disabled form reports the same policy shape with isActive false. A practical receiver checklist is: verify the signature first, confirm the event type, deduplicate using the event ID, then apply the policy identified by its location and leave type.
Headers to check before processing
Every delivery carries headers that identify the webhook, the event and the delivery attempt. VT-Signature provides the signed timestamp and HMAC value used for verification; after a secret rotation, a second signature entry signed with the previous secret may be present for 24 hours. VT-Webhook-Id identifies the webhook for this delivery. VT-Event-Id matches the id field in the body and should be used to skip duplicates. VT-Event-Type matches the type field in the body. VT-Delivery-Id is unique per delivery and remains stable across retries, while VT-Delivery-Attempt starts at 1 and increments for each attempt. See the header definitions below.
Payload fields worth mapping
The JSON body uses API version 2 and contains an event id, type, createdAt timestamp, companyId and a data object. The data object follows the shape returned by the matching GET endpoint for the affected policy. Key fields to map in your receiver include locationId and leaveTypeId to identify the policy, isActive to confirm it is active, quotaUnit with daysPerYear and hoursPerYear for the yearly allowance, rollover limits, unlimited-leave and approval flags, reason and visibility controls, past-date and negative-balance rules, the shortest requestable interval, accrual settings, brought-forward expiry and TOIL settings. Optional fields may be absent when they are not set, so your parser should treat missing optional values as unset rather than as zero. An optional apiClient object is present only when the change originated through the API, and it identifies the key and its owner. See the request body fields below.
Failure distinctions and receiver checklist
A common failure is applying the same change twice after a retry. Because the event ID is deterministic for a given change, store processed IDs and ignore repeats. A second failure is trusting the body before signature verification, which would allow forged payloads to alter local policy data. A third is assuming every optional field is present; accrual, rollover-expiry and TOIL sub-objects omit unset fields, so defaults must be handled explicitly. Finally, do not confuse this event with a test delivery: webhook.test events are only for testing, cannot be subscribed to, and carry a different payload shape.
Frequently asked questions
How should a receiver handle duplicate or retried deliveries?
Use the event ID from the header and body to recognise a repeat delivery, verify the signature before trusting the payload, and check the delivery attempt number to understand retries. The delivery ID stays the same across retries of the same delivery.
Does this event cover only first-time activation?
The enabled event covers both a first activation and a later change to an already active policy. A separate disabled event covers deactivation, where the policy is returned with isActive set to false.
What permission does the owner need?
The webhook owner needs leave-policies:read. That permission is the access requirement stated for this event.
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 |