Skip to content

leave.requested: a leave request awaiting approval

The leave.requested webhook fires when a user submits a leave that needs approval. The affected leave in the payload has status OPEN. This page covers the delivery headers, the payload shape, and the scope the webhook owner needs.

When this event fires

The event is sent at the moment a user requests a leave that requires approval. The leave in the payload is in OPEN status. If the leave policy needs no approval, the request is auto-approved and a different event (leave.added) is sent instead. Use this event to notify approvers or to start an approval workflow.

Required scope

The webhook owner needs the leaves:read scope. Without it, the reason field is null. To receive the reason text, the owner also needs leaves:read-reason.

Delivery headers

Every delivery carries these headers. Use VT-Event-Id to skip duplicate deliveries, and VT-Delivery-Id to track retries of the same delivery.

Payload shape

The body is a LeaveWebhookEvent. It contains id, type, apiVersion, createdAt, companyId, data, and an optional apiClient. The data object is the affected leave in the same shape the matching GET endpoint returns. For this event, data.status is OPEN.

Distinguishing leave.requested from other leave events

The leave family includes several events. leave.requested is the only one that fires for a leave awaiting approval. leave.added fires when an approved leave is added or auto-approved. leave.updated fires when a leave changes. leave.approved, leave.denied, leave.cancelled, leave.deleted, and leave.expired cover the other state transitions. Subscribe to the specific event you need rather than filtering a broader stream.

Example: a leave request that needs approval

A user submits a three-day leave. The policy requires approval, so the leave is created with status OPEN. The webhook fires with type leave.requested. The data object includes the leave id, userId, startDate, endDate, durationCalendarDays, durationWorkingDays, isFullDayLeave, leaveTypeId, locationId, departmentId, status OPEN, and createdAt. If the owner has leaves:read-reason, the reason field carries the user's text; otherwise it is null. The approverId field is absent because no approver has acted yet.

Checklist before you subscribe

  1. Confirm the webhook owner has leaves:read. 2. Add leaves:read-reason if you need the reason text. 3. Verify your endpoint checks VT-Signature. 4. Store VT-Event-Id to deduplicate. 5. Handle the OPEN status explicitly. 6. Do not expect approverId on this event.
Leave event comparison
EventWhen it firesLeave status
leave.requestedA user requests a leave that needs approvalOPEN
leave.addedAn approved leave is added, or a leave is auto-approvedAPPROVED
leave.updatedA leave is changedvaries
leave.approvedA leave is approvedAPPROVED
leave.deniedA leave is deniedDENIED
leave.cancelledA leave is cancelledCANCELLED
leave.deletedA leave is deletedDELETED
leave.expiredA leave request expires without a decisionEXPIRED

Status values are from the event payload schema. leave.updated may carry any status.

Frequently asked questions

What is the difference between leave.requested and leave.added?

leave.requested fires when a user submits a leave that needs approval; the leave is OPEN. leave.added fires when an approver or admin adds an already approved leave, or when a requested leave is approved automatically because its policy needs no approval.

Why is the reason field null?

The reason field requires the leaves:read-reason scope. Without it, the value is null. With it, the field carries the user's text, or an empty string when none was given.

How do I avoid processing the same event twice?

Use VT-Event-Id from the header or id from the body. They are the same value. The ID is deterministic, so the same change always has the same ID. webhook.test events get a random ID.

What does VT-Delivery-Id track?

VT-Delivery-Id is unique per delivery and kept across retries of the same delivery. VT-Delivery-Attempt gives the attempt number, starting at 1.

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