TOIL request approved webhook (toil.approved)
When a TOIL request moves to approved, your system can react immediately instead of polling. approved delivery: who must hold which scope, which headers identify and authenticate the delivery, and which fields in the JSON body describe the approved TOIL.
When this event fires and who can receive it
Subscribe only if your integration needs to act on approval — for example updating balances, notifying the employee, or syncing a calendar. The owner of the webhook needs the toil:read scope. Approval can come from an approver, a location admin, or an admin; the event itself does not tell you which role acted, so read the approver and status fields in the payload rather than inferring the actor.
Headers: authenticate, identify, deduplicate
Verify VT-Signature against the raw body before parsing. VT-Event-Id mirrors the body's id and is deterministic for the same change, making it the right key to skip duplicates. VT-Delivery-Id identifies one delivery across its retries, and VT-Delivery-Attempt tells you which try you are on. VT-Event-Type mirrors the body's type, so cross-check the two. A practical handler order is: verify signature, check VT-Event-Type is toil.approved, deduplicate on VT-Event-Id, then process data.
Body: reading the approved TOIL payload
The body is application/json with apiVersion "2" and an ISO 8601 createdAt timestamp. The data object matches the shape returned by the matching GET endpoint for the TOIL resource. For an approval, expect status APPROVED and an approvalDate timestamp; approverId is populated once approved. Dates use YYYY-MM-DD. Part-day TOIL sets isFullDayLeave to false and includes start and end hour and minute fields in the user's time zone; durationWorkingDays converts part-day hours using an 8-hour day regardless of the user's working hours. locationId and departmentId reflect where the user was when the request was sent, not necessarily their current assignment.
Reason fields and the apiClient object
Two reason fields need care. The user's reason for the TOIL and the reason given on denial or cancellation both require the leaves:read-reason scope, which covers leaves and TOIL alike; without that scope the values arrive as null, so do not treat null as an empty reason. The optional apiClient object appears only when the change was made through the API and identifies the key that made it. If you need the reason text, request the scope up front rather than handling nulls as a fallback.
Distinguishing approval from neighbouring TOIL events
Do not confuse this event with its neighbours. toil.requested means a request is awaiting a decision; toil.added covers approved TOIL being added or auto-approved; toil.updated covers edits such as dates, times, leave type, or reason; toil.denied is the refusal counterpart. Only toil.approved signals a granted request with an approval timestamp. Filtering on VT-Event-Type or body type before processing keeps these flows separate.
| Header | Purpose | Handling note |
|---|---|---|
| VT-Signature | Authenticates the delivery over the raw body | Verify first; accept a second v1 during the 24-hour rotation window |
| VT-Webhook-Id | Identifies the webhook this delivery belongs to | Use to route or log per webhook |
| VT-Event-Id | Same value as body id | Deduplication key for the event |
| VT-Event-Type | Same value as body type | Filter for toil.approved before processing |
| VT-Delivery-Id | Unique per delivery, stable across retries | Correlate retries of the same delivery |
| VT-Delivery-Attempt | Attempt number starting at 1 | Track retry progress |
All listed headers are required on every delivery.
| Body field | What it tells you | Watch out for |
|---|---|---|
| id / type | Event identity and event kind | type is toil.approved for this page |
| apiVersion / createdAt | Data shape version and event time | apiVersion is "2"; createdAt is ISO 8601 |
| data.status | TOIL request status | APPROVED on this event |
| data.approvalDate | When approval happened | Null until approved |
| data.approverId | Who approved | Null until approved |
| data.isFullDayLeave | Full-day vs part-day TOIL | Part-day adds hour/minute fields |
| data.reason / data.statusReason | User reason and decision reason | Null without leaves:read-reason scope |
| apiClient | API key that made the change | Present only for API-made changes |
Fields marked optional in the contract may be absent or null.
Frequently asked questions
What triggers the toil.approved webhook?
This delivery fires when an approver, a location admin, or an admin grants a TOIL request. The webhook owner must hold the toil:read scope to receive it.
How should duplicate deliveries be handled?
Treat VT-Event-Id, which matches the body's id field, as the deduplication key. VT-Delivery-Id stays the same across retries of one delivery, while VT-Delivery-Attempt counts attempts starting at 1, so you can distinguish a repeated delivery from a new event.
What must be checked before trusting the payload?
Check VT-Signature first, using the raw request body exactly as received. During the 24 hours after a secret rotation, a second v1 value signed with the previous secret may be present, so accept either valid signature during that window.
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 |