Skip to content

leave.expired: a leave request that expired without a decision

The leave.expired event is delivered when an open leave request reaches its expiry without anyone approving or denying it. It is a signal that the request lapsed rather than being decided, so downstream systems should treat it as a distinct outcome from approval, denial or cancellation. This reference covers when the event fires, the required scope, the delivery headers, and how to read the leave payload.

When leave.expired is delivered

The event is sent when an open leave request expires because no approver approved or denied it in time. The webhook owner must hold the leaves:read scope. The event type is leave.expired, and the body's type field carries the same value as the VT-Event-Type header.

Because the request was never decided, the leave's status is EXPIRED. This is the key difference from leave.denied (a decision was made to refuse) and leave.cancelled (the requester or system withdrew it). Treat the three as separate branches in your handler.

Delivery headers to expect

Each delivery carries a fixed set of headers. VT-Signature is required. Its value is built as t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">, so the signed material is the timestamp, a literal dot, then the raw body. When a secret is rotated, deliveries for the following 24 hours also include a second v1 entry produced with the previous secret. The signature verification section at the top of this document explains how to check it. The other required headers are VT-Webhook-Id, VT-Event-Id, VT-Event-Type, VT-Delivery-Id, VT-Delivery-Attempt and User-Agent. VT-Delivery-Attempt is an integer starting at 1, and VT-Delivery-Id stays the same across retries of the same delivery. Use VT-Event-Id to skip duplicate deliveries.

Reading the leave payload

The body is a LeaveWebhookEvent object. The top-level fields are id, type, apiVersion (value "2"), createdAt (ISO 8601), companyId, data, and an optional apiClient present only when the change was made through the API. The data object is the affected leave in the same shape the matching GET endpoint returns.

Within data, the required fields include id, userId, durationCalendarDays, durationWorkingDays, startDate, endDate, isFullDayLeave, leaveTypeId, locationId, departmentId, status, reason, statusReason, approvedLevel and createdAt. The optional approverId and autoApproved fields appear only where relevant. Part-day fields (startHour, endHour, startMinute, endMinute) are returned only when isFullDayLeave is false. The user, approver and leaveType objects are included only when the corresponding expansion is requested.

Status, approval level and reason fields

The status field is one of APPROVED, OPEN, DENIED, CANCELLED, EXPIRED or DELETED. For a leave.expired event, expect EXPIRED. The approvedLevel field is FIRST, SECOND, THIRD or null; it is meaningful in departments with multi-level approval, and an OPEN leave with approvedLevel FIRST is waiting for the second-level approver.

The reason field is the reason the user gave, an empty string when none was given, and requires the leaves:read-reason scope; without it the value is null. The statusReason field is the reason given when the leave was denied or cancelled, null when none was given, and also requires leaves:read-reason. For an expired request, statusReason is typically null because no decision was recorded.

Worked example: interpreting an expired request

Suppose a two-day leave request in a department with multi-level approval reaches expiry while still at the first approval level. The delivered body would show type of leave.expired, data.status of EXPIRED, data.approvedLevel of FIRST, data.durationCalendarDays of 2, and data.statusReason of null. The approverId would be absent because the request was never approved. A handler that branches on status can route this to a "lapsed, needs re-request" path rather than an "approved" or "denied" path.

Handler checklist

  • Verify the VT-Signature header against the raw body before parsing.
  • Confirm VT-Event-Type is leave.expired and that the body type matches.
  • Deduplicate using VT-Event-Id (or the body id) before processing.
  • Read data.status and confirm it is EXPIRED; branch separately from DENIED and CANCELLED.
  • Check data.approvedLevel to understand how far the request progressed.
  • Treat data.statusReason as null for expired requests unless a reason was recorded.
  • Request the leaves:read-reason scope if you need the user's reason value.
  • Handle VT-Delivery-Attempt greater than 1 as a retry of the same delivery.

Frequently asked questions

How is leave.expired different from leave.denied?

A leave.denied event means an approver decided to refuse the request. A leave.expired event means the request reached its expiry without any approval or denial. In both cases the leave is no longer open, but the status differs (DENIED versus EXPIRED) and the statusReason field is typically populated for a denial and null for an expiry.

What scope does the webhook owner need for leave.expired?

The webhook owner needs the leaves:read scope. To receive the user's reason and the statusReason values, the owner also needs the leaves:read-reason scope; without it those fields are null.

How do I avoid processing the same expired event twice?

Use the VT-Event-Id header, which matches the body id. The ID is deterministic, so the same change always carries the same ID. Compare it against a store of recently processed IDs and skip any delivery whose ID you have already handled. VT-Delivery-Id stays the same across retries of the same delivery, so it can also help you recognise a retry.

Why are startHour and endHour missing from some expired events?

Those fields are returned only when isFullDayLeave is false. For a full-day leave, the part-day fields are omitted, so your handler should treat them as optional and check isFullDayLeave before reading them.

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