Skip to content

leave.approved Webhook Event

The leave.approved event fires when an approver, location admin, or admin approves a leave request. This reference covers the delivery headers, the JSON body shape, which fields are conditional, and how to handle retries and duplicates.

When leave.approved fires

The event is sent when an approver, a location admin, or an admin approves a leave. The owner needs the leaves:read scope. The autoApproved boolean in the body indicates whether the leave request was automatically approved. The separate leave.added event covers an approved leave being added or a leave being auto-approved; it is a distinct event, not a replacement for leave.approved.

Delivery headers

Every delivery carries these headers. The signature header is the one to check before trusting the payload.

Request body

The body is JSON. The top-level envelope contains the event ID, type, API version, creation timestamp, company ID, and the data object. The data object carries the affected resource, shaped the same way as the matching GET endpoint's response. When a resource has been deleted, data uses WebhookDeletedResourceData instead; operation events use OperationWebhookData. The webhooks section lists the data schema for each event. A webhook.test event instead carries { "webhookId", "message" }. The apiClient field is present only when the change was made through the API.

Conditional fields in the leave data

Several fields in the data object are present only under specific conditions. The table below maps each conditional field to its trigger.

Handling deliveries

A practical sequence for processing a leave.approved delivery:

Example payload

A representative leave.approved body for a full-day leave approved by a manager. Field values are illustrative; the shape matches the contract.

Conditional fields in the leave data object
FieldTypeWhen presentNotes
approverIdstringOnly when the leave request is approvedAbsent otherwise
autoApprovedbooleanOptional (required: false)Indicates whether the leave request was automatically approved
startHour / endHour / startMinute / endMinutenumberOnly when isFullDayLeave is falseIn the user's time zone, 24h format
reasonstring | nullAlways (may be null)Requires leaves:read-reason scope; with the scope, an empty string when the user gave no reason; without the scope, null
statusReasonstring | nullAlways (may be null)Requires leaves:read-reason scope; null when none was given; without the scope, null
approvedLevelstring | nullAlways (may be null)FIRST/SECOND/THIRD; null outside multi-level approval. An OPEN leave with approvedLevel FIRST is waiting for the second-level approver.
userobjectOnly when expand includes userFull user object
approverobjectOnly when expand includes approverThe approver, including location and department
leaveTypeobjectOnly when expand includes leaveTypeid, name, isDefault
apiClientobjectOnly when change made via APIkeyId, name, ownerId

Field presence conditions are taken from the contract schema. The expand parameter controls inclusion of user, approver, leaveType, location, department, and holidays objects.

Frequently asked questions

When does the leave.approved webhook fire?

It fires when an approver, location admin, or admin approves a leave. The owner needs the leaves:read scope. The autoApproved boolean indicates whether the approval was automatic. The separate leave.added event covers an approved leave being added or a leave being auto-approved.

How do I avoid processing the same approval twice?

Use the VT-Event-Id header (identical to the body's id). For non-test events the ID is deterministic, so the same change always produces the same value. Skip any delivery whose event ID you have already processed. webhook.test events get a random ID and are not deterministic. The VT-Delivery-Id stays constant across retries of one delivery, while VT-Delivery-Attempt increments from 1.

Why is the reason field null?

The reason and statusReason fields require the leaves:read-reason scope on the owner. Without that scope, both are null. With it, reason is an empty string when the user gave no reason, and statusReason is null when none was given.

What does the VT-Signature header contain?

It has the form t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">. If the signing secret was rotated within the last 24 hours, the header also includes a second v1 entry produced with the previous secret. Signature verification is covered at the top of this document.

Can I subscribe to webhook.test?

No. webhook.test is sent only by test deliveries and cannot be subscribed to. Test events get a random ID rather than a deterministic one.

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