ef777d51e6f2
Create a request
Create a leave request.
Date/Time Format: All dates must be in ISO 8601 format with UTC timezone (e.g., '2024-01-15T09:00:00Z').
Day-based leave types (leave_unit: days):
- Use start_at: 'morning' or 'afternoon' to specify when the absence starts
- Use end_at: 'lunchtime' or 'end_of_day' to specify when the absence ends
- Example full day: start='2024-01-15T00:00:00Z', end='2024-01-15T00:00:00Z', start_at='morning', end_at='end_of_day'
- Example half day (morning): start='2024-01-15T00:00:00Z', end='2024-01-15T00:00:00Z', start_at='morning', end_at='lunchtime'
- If start_at/end_at are omitted, they default to 'morning'/'end_of_day' (full day)
- For leave types with leave_unit 'days' (full days only), start_at='afternoon' or end_at='lunchtime' is rejected (each on its own) — use a 'half_days' leave type for half-day absences
Hour-based leave types (leave_unit: hours):
- Include the exact time in the start and end timestamps
- The start_at and end_at parameters are ignored
- Example: start='2024-01-15T09:00:00Z', end='2024-01-15T12:30:00Z' for a 9:00-12:30 UTC absence
Representatives: If the leave type or member requires representatives, pass representative_member_ids. Admin API keys creating for another member may instead set ignoreRepresentativeRequirement: true.
Employment period: The absence must fall entirely inside the member's employment period. A request starting before employment_start_date or ending after employment_end_date is rejected with 400. Both boundary dates are themselves bookable, and a null boundary means open ended on that side. A range that straddles a boundary is rejected rather than truncated.
The check compares calendar days, not exact timestamps. For an hour-based leave type, any time of day on employment_end_date is still inside the period (e.g. start='2024-09-30T09:00:00Z', end='2024-09-30T17:00:00Z' with employment_end_date '2024-09-30' is accepted) — midnight is not the cutoff. The same applies to employment_start_date.
Request body
Response
Successful response