Preview a request (dry run)
Answer what POST /requests would do with this payload without creating anything: the workday duration, its split by fiscal year, whether the member's allowance covers it, the existing requests it would collide with, and a single can_create verdict.
Input: identical to POST /requests, so one payload can be sent to both URLs. reason, representative_member_ids and ignoreRepresentativeRequirement are evaluated exactly as on create.
Duration: duration.workday_absence_duration uses the same days-vs-minutes rule as workday_absence_duration on GET /requests (days for day and half-day leave units, minutes for hour units); preview and created request always agree. For day-based leave types the time of day in start / end is ignored, exactly as on create.
Allowance: is_allowance_sufficient: false means POST /requests with this payload fails with the allowance error; true means it passes that check. Leave types that do not deduct return takes_from_allowance: false, allowance_type: null and is_allowance_sufficient: true.
Conflicts: conflicts lists the member's existing requests that overlap this absence and would block creation. Every leave type counts, including informational ones such as home office; only declined or cancelled requests are ignored.
Rejection: the preview runs the same validations as POST /requests, in the same order, with one difference: an overlapping request is not a rejection but goes to conflicts, so where POST /requests would stop with the overlap error the preview keeps going and may name a later rule in rejection while the overlap sits in conflicts. When a rule fails, the response is still 200 with rejection set instead of a 400, and can_create is false. Match on rejection.code: START_AFTER_END, HALF_DAY_NOT_ALLOWED_FOR_FULL_DAY_LEAVE_TYPE, LEAVE_TYPE_DISABLED (disabled for this member), REASON_REQUIRED, REASON_TOO_LONG, OUTSIDE_FISCAL_YEAR_WINDOW, PAST_DATE_NOT_ALLOWED (manager or self-service retroactive limits), OUTSIDE_EMPLOYMENT_PERIOD, REPRESENTATIVE_CONFLICT (the member is someone else's accepted representative in that period), MAX_ABSENT_REACHED (department limit), NO_APPROVER_SET (the leave type needs approval and the member has no approver), REPRESENTATIVES_INVALID, REQUIRED_REPRESENTATIVES_COUNT_NOT_MET. Permission and scoping failures stay real 403 / 404 responses.
Verdict: can_create is true only when rejection is null, conflicts is empty and the allowance covers the absence. It is the one field to gate a create call on.
Side effects: no request, approver, notification, webhook or calendar sync entry is created. Safe to repeat; each call evaluates the data as it is at that moment.
Request body
Response
Successful response
Changes
Changed in 1 of the 13 revisions of this API.1
- ○
endpoint added
endpoint-added
- ○