TOIL Expired Webhook Event
The toil.expired webhook fires when an open time-off-in-lieu (TOIL) request reaches its deadline without an approval or denial.
When this event fires
A TOIL request that stays open past its deadline is marked expired, and the toil.expired event is sent. The event belongs to the TOIL family of webhook types and is delivered as a POST to your endpoint. The webhook owner must hold the toil:read scope. Expiration is a distinct outcome from denial or cancellation: no approver decision was recorded, so the request simply ran out of time.
Headers to expect
Every delivery carries a set of headers you should validate before reading the body. The signature header uses a keyed timestamp and HMAC scheme; during a secret rotation window a second signature entry is included. The event ID header matches the id field in the body and is the recommended deduplication key. The delivery ID stays stable across retries, while the delivery attempt counter starts at 1 and increases on each retry. The event type header matches the type field. The user-agent string identifies the sender.
Payload fields for an expired TOIL request
The body is JSON and follows the TOIL webhook event shape. The top-level fields are id, type, apiVersion, createdAt, companyId, data, and an optional apiClient block. For toil.expired, type is the string toil.expired and apiVersion is "2". The data object carries the TOIL request: id, userId, approverId, leaveTypeId, startDate, endDate, isFullDayLeave, optional startHour, endHour, startMinute, endMinute, durationWorkingDays, locationId, departmentId, status, reason, statusReason, approvalDate, createdAt, and any additional keys. On an expired request, status is EXPIRED, approverId is null because no approval occurred, and approvalDate is null. The reason and statusReason fields are null unless the leaves:read-reason scope is granted.
Field and control map
Use this map to decide which values to read first when a toil.expired delivery arrives.
Expiration vs denial vs cancellation
These three outcomes share the TOIL event family but differ in meaning and in some payload values. A denial records an approver decision; a cancellation records that the request was withdrawn; an expiration records that the deadline passed with no decision. In all three cases the request is no longer open, but only denial and cancellation may carry a statusReason explaining the decision. Treating expiration as a denial can misstate the record, so branch on the type value and the status value rather than on the absence of an approval alone.
Handling checklist
- Verify the signature header before parsing the body. 2. Confirm the event type header equals toil.expired. 3. Deduplicate on the event ID header and the body id field. 4. If the delivery attempt is greater than 1, treat it as a retry of the same delivery ID. 5. Read status and confirm it is EXPIRED. 6. Read approverId and approvalDate and confirm both are null. 7. Read durationWorkingDays if you need the day count, remembering that part-day TOIL is converted using an 8-hour day regardless of the user's working hours. 8. Read reason and statusReason only when the leaves:read-reason scope is granted; otherwise expect null. 9. Route the event to your expiration workflow, not your denial workflow.
Worked example
Suppose a user submits a part-day TOIL request for 4 hours and no approver acts before the deadline. The toil.expired delivery arrives with type toil.expired, status EXPIRED, approverId null, approvalDate null, and isFullDayLeave false. The startHour, endHour, startMinute, and endMinute fields are present because the request is part-day. durationWorkingDays reports 0.5, because 4 hours is converted using an 8-hour day. If your integration only reads the day count and assumes a full working day, it will overstate the TOIL by a factor of two. Read isFullDayLeave alongside durationWorkingDays to interpret the number correctly.
| Field or header | Where it appears | What to check on expiration |
|---|---|---|
| VT-Signature | Header | Verify the HMAC before parsing. |
| VT-Event-Id | Header | Matches body id; use for deduplication. |
| VT-Delivery-Id | Header | Stable across retries of the same delivery. |
| VT-Delivery-Attempt | Header | Starts at 1; greater than 1 means retry. |
| type | Body | Equals toil.expired. |
| apiVersion | Body | Equals "2". |
| status | Body data | Equals EXPIRED. |
| approverId | Body data | Null because no approval occurred. |
| approvalDate | Body data | Null because no approval occurred. |
| durationWorkingDays | Body data | Part-day TOIL converted using an 8-hour day. |
| reason | Body data | Null unless leaves:read-reason is granted. |
| statusReason | Body data | Null unless leaves:read-reason is granted. |
Values reflect the documented TOIL webhook event shape; optional fields such as startHour and endHour appear only when isFullDayLeave is false.
Frequently asked questions
Does toil.expired mean the request was denied?
No. Expiration means the deadline passed without an approval or denial. The status is EXPIRED, approverId is null, and approvalDate is null. Denial is a separate event type with its own payload values.
Which scope does the webhook owner need?
The owner needs toil:read. To read the reason and statusReason fields, the leaves:read-reason scope is also required; without it those fields are null.
How do I avoid processing the same expiration twice?
Deduplicate on the VT-Event-Id header, which matches the id field in the body. The VT-Delivery-Id stays the same across retries, and VT-Delivery-Attempt tells you which attempt you are handling.
Why is durationWorkingDays not a whole number?
Part-day TOIL is converted using an 8-hour day regardless of the user's working hours. A 4-hour request reports 0.5. Read isFullDayLeave to know whether the value represents full days or a converted part-day amount.
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 |