Skip to content

toil.requested: TOIL Request Awaiting Approval

The toil.requested event is delivered when a user submits time-off-in-lieu that requires an approval decision. At the moment of delivery the TOIL request in data carries status OPEN. The webhook owner must hold the toil:read scope. This reference covers the delivery headers, the payload shape, and the field-level behaviors that matter when you build an approval workflow around the event.

When toil.requested fires

Use this event as the trigger for an approval queue or notification. It is distinct from the other TOIL events: toil.added covers the case where an approver or admin records TOIL that is already approved, or where the system approves a TOIL request on its own; toil.approved covers an explicit approval. The payload at delivery time is the affected resource in the same shape the matching GET endpoint returns, so you can read it directly without a follow-up fetch for most fields.

Delivery headers and verification

Payload fields

The body is application/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 variants, and apiVersion is "2". createdAt is an ISO 8601 timestamp. companyId identifies the company. apiClient is present only when the change was made through the API and carries keyId, an optional name, and ownerId.

Inside data

The data object describes the TOIL request. Required fields include id, userId, approverId, leaveTypeId, startDate, endDate, isFullDayLeave, locationId, departmentId, status, reason, statusReason, approvalDate, and createdAt. approverId is null until the request is approved. startDate and endDate use YYYY-MM-DD. When isFullDayLeave is false, startHour, endHour, startMinute, and endMinute are returned in the user's time zone in 24-hour format. durationWorkingDays is the duration in days: a full-day TOIL counts each day it covers, while a part-day TOIL converts its hours using an 8-hour day regardless of the user's actual working hours. locationId and departmentId reflect the user's location and department at the time the request was sent. status is one of OPEN, APPROVED, DENIED, CANCELLED, EXPIRED, or DELETED; for this event it is OPEN. approvalDate is null until approval. reason and statusReason require the leaves:read-reason scope, which covers leaves and TOIL alike; without it both are null.

Field and control map

Use this checklist when implementing a handler. Confirm toil:read is granted to the webhook owner. Verify VT-Signature against the raw body before parsing. Deduplicate on VT-Event-Id. Track retries with VT-Delivery-Id and VT-Delivery-Attempt. Read status and expect OPEN for this event. Branch on isFullDayLeave before reading hour and minute fields. Treat reason and statusReason as nullable unless leaves:read-reason is granted. Treat approverId and approvalDate as nullable until approval.

Delivery header contract
HeaderTypeRequiredBehavior
VT-SignaturestringYest=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">; second v1 entry for 24 hours after secret rotation
VT-Webhook-IdstringYesID of the webhook the delivery is for
VT-Event-IdstringYesMatches body id; deterministic; use to skip duplicates
VT-Event-TypestringYesMatches body type
VT-Delivery-IdstringYesUnique per delivery; persists across retries
VT-Delivery-AttemptintegerYesAttempt number starting at 1; range 1 <= value
User-AgentstringYes—

Header names and behaviors are exact contract values. The User-Agent value is a fixed literal supplied by the owner.

Frequently asked questions

What triggers a toil.requested webhook?

It is sent when a user requests TOIL that needs approval. The TOIL request in data is OPEN at delivery. The webhook owner needs the toil:read scope.

How does toil.requested differ from toil.added?

toil.requested fires when a user submits a request that needs approval. toil.added fires in two cases: an approver or admin records TOIL that is already approved, or the system approves a TOIL request on its own. Both events require toil:read.

How is durationWorkingDays calculated for part-day TOIL?

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.

Why are reason and statusReason null?

Both fields require the leaves:read-reason scope, which covers leaves and TOIL alike. Without that scope the value is null.

How do I avoid processing the same delivery twice?

Use VT-Event-Id, which matches the body id and is deterministic for the same change. VT-Delivery-Id is unique per delivery and persists across retries, so it distinguishes retry attempts of the same delivery.

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