toil.updated: A TOIL Request Was Changed
The toil.updated webhook event fires when a time-off-in-lieu (TOIL) request is modified — for example its dates, times, leave type, or reason. This page documents the trigger, required scope, authentication and delivery headers, and the full payload shape so you can build a reliable handler.
When toil.updated fires
The event is sent when a TOIL request is changed. Typical changes include adjustments to the request's dates, times, leave type, or reason. The webhook owner must hold the toil:read scope to receive it. Use this event when you need to react to in-place edits of an existing TOIL request; use toil.added or toil.approved when a new or already-approved TOIL entry is created, and toil.denied, toil.cancelled, or toil.deleted when the request leaves the open state through those paths.
Headers on every delivery
Payload shape
The body is JSON and follows the ToilWebhookEvent shape. Top-level fields are id, type, apiVersion, createdAt, companyId, data, and an optional apiClient. The type field for this event is one of the TOIL event values, including toil.updated. The apiVersion is "2". The data object mirrors the shape returned by the matching GET endpoint and includes the TOIL request fields listed below.
TOIL request field map
The data object contains the following fields. Required fields are always present; optional fields appear only under the stated conditions.
Status values and reason scope
The status field is one of OPEN, APPROVED, DENIED, CANCELLED, EXPIRED, or DELETED. The reason field holds the reason the user gave for the TOIL and requires the leaves:read-reason scope, which covers leaves and TOIL alike; without that scope the value is null. The statusReason field holds the reason given when the request was denied or cancelled and is null when none was given; it also requires leaves:read-reason and returns null without it. The approvalDate field is null until the request is approved. The approverId field is null until the request is approved.
Worked example: a part-day TOIL change
Suppose a user has a part-day TOIL request for 3 hours on 2026-03-10 and an admin edits the end time. Because isFullDayLeave is false, the payload includes startHour, endHour, startMinute, and endMinute in the user's time zone (24-hour format). The durationWorkingDays field converts the hours using an 8-hour day regardless of the user's working hours, so 3 hours becomes 0.375. If the user later changes the reason, a new toil.updated event fires with the same deterministic id only if the change is identical; a different reason produces a different id. If the handler lacks leaves:read-reason, both reason and statusReason arrive as null and the change to the reason is invisible in the payload.
Three failure modes to distinguish
A missing or invalid VT-Signature is an authentication failure: the handler should reject the delivery and not process the body. A duplicate VT-Event-Id is not a failure: it is the same change redelivered, and the handler should skip it. A null reason or statusReason is not a delivery failure: it usually means the leaves:read-reason scope is absent, and the handler should treat the field as unavailable rather than as an empty reason. Keeping these three cases separate prevents both double-processing and silent data loss.
Handler checklist
Before deploying a toil.updated handler, confirm the following: the webhook owner holds toil:read; the handler verifies VT-Signature against the raw body before parsing; the handler deduplicates on VT-Event-Id; the handler tolerates a second v1 signature entry during the 24-hour rotation window; the handler treats reason and statusReason as nullable when leaves:read-reason is absent; the handler distinguishes toil.updated from toil.added, toil.approved, toil.denied, toil.cancelled, and toil.deleted by the type field; and the handler reads startHour, endHour, startMinute, and endMinute only when isFullDayLeave is false.
| Header | Type | Required | Meaning |
|---|---|---|---|
| VT-Signature | string | Yes | t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">; a second v1 entry appears for 24 hours after a secret rotation |
| VT-Webhook-Id | string | Yes | the ID of the webhook the delivery is for |
| VT-Event-Id | string | Yes | the event ID, the same as id in the body; use it to skip duplicate deliveries |
| VT-Event-Type | string | Yes | the event type, the same as type in the body |
| VT-Delivery-Id | string | Yes | the delivery ID, unique per delivery and kept across retries of the same delivery |
| VT-Delivery-Attempt | integer | Yes | the attempt number of this delivery, starting at 1; range 1 <= value |
| User-Agent | string | Yes | — |
Header names and values are exact contract fields; do not rename or reorder.
| Field | Type | Required | Meaning |
|---|---|---|---|
| id | string | Yes | event ID, the same as the VT-Event-Id header; deterministic, so the same change always has the same ID; use it to skip duplicates; webhook.test events get a random ID |
| type | string | Yes | the event type; webhook.test is sent only by test deliveries and cannot be subscribed to |
| apiVersion | string | Yes | the API version of the data shape; value in "2" |
| createdAt | string (date-time) | Yes | a timestamp in the ISO 8601 format of when the event was created |
| companyId | string | Yes | the ID of the company |
| data | object | Yes | the affected resource, in the same shape the matching GET endpoint returns |
| apiClient | object | No | the API key that made the change, present only when the change was made through the API |
Field names and types are exact contract fields.
| Field | Type | Required | Meaning |
|---|---|---|---|
| id | string | Yes | TOIL request ID |
| userId | string | Yes | an ID of the user who earned the TOIL |
| approverId | string | null | Yes | an ID of the approver, null until the request is approved |
| leaveTypeId | string | Yes | the ID of the leave type the TOIL is added to |
| startDate | string (date) | Yes | date in YYYY-MM-DD format |
| endDate | string (date) | Yes | date in YYYY-MM-DD format |
| isFullDayLeave | boolean | Yes | true if the TOIL covers full days, false if it covers part of a day |
| startHour | number | No | start hour in the user's time zone (in 24h format), returned only when isFullDayLeave is false |
| endHour | number | No | end hour in the user's time zone (in 24h format), returned only when isFullDayLeave is false |
| startMinute | number | No | start minutes in the user's time zone, returned only when isFullDayLeave is false |
| endMinute | number | No | end minutes in the user's time zone, returned only when isFullDayLeave is false |
| durationWorkingDays | number | No | the duration of the TOIL in days; a full-day TOIL counts each day it covers; a part-day TOIL converts its hours using an 8-hour day, whatever the user's working hours |
| locationId | string | Yes | the ID of the user's location when the TOIL request was sent |
| departmentId | string | Yes | the ID of the user's department when the TOIL request was sent |
| status | ToilStatus | Yes | TOIL request status; one of "OPEN" | "APPROVED" | "DENIED" | "CANCELLED" | "EXPIRED" | "DELETED" |
| reason | string | null | Yes | the reason the user gave for the TOIL; requires the leaves:read-reason scope, which covers leaves and TOIL alike; without it the value is null |
| statusReason | string | null | Yes | the reason given when the TOIL request was denied or cancelled, null when none was given; requires the leaves:read-reason scope; without it the value is null |
| approvalDate | string | null (date-time) | Yes | a timestamp in the ISO 8601 format, null until the request is approved |
| createdAt | string (date-time) | Yes | a timestamp in the ISO 8601 format |
Field names, types, and requiredness are exact contract fields; do not rename or reorder.
Frequently asked questions
What scope does the webhook owner need for toil.updated?
The owner needs the toil:read scope. Separately, the reason and statusReason fields require the leaves:read-reason scope; without it those fields arrive as null.
How do I avoid processing the same TOIL change twice?
Use the VT-Event-Id header, which matches the id field in the body. The ID is deterministic, so the same change always has the same ID. Skip any delivery whose VT-Event-Id you have already processed.
Why does VT-Signature sometimes contain two v1 entries?
For 24 hours after a secret rotation, the header carries a second v1 entry signed with the previous secret. Your verifier should accept a delivery if any v1 entry matches a currently valid secret.
How is toil.updated different from toil.approved?
toil.updated fires when an existing TOIL request is changed, for example its dates, times, leave type, or reason. toil.approved fires when an approver, location admin, or admin approves a TOIL request. A single request can produce both events at different times.
When are startHour, endHour, startMinute, and endMinute present?
Those four fields are returned only when isFullDayLeave is false, meaning the TOIL covers part of a day. For full-day TOIL they are absent, and durationWorkingDays counts each day the TOIL covers.
Where can I get help with this event?
Contact the developer support address listed in the site's developer documentation for questions about this webhook 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 |