Create Time Off Request
Creates a time off request — vacations, leave or a permission — for a user of the organization against one of its time off policies. The request follows the rules of the policy: when the policy needs approvals it is created as IN_PROGRESS and its approvers are notified; otherwise it is created as APPROVED and the time is discounted from the user’s balance. The dates cannot overlap another active request of the user.
Authentication
API key of the organization. Always sent together with the Secret-Access header.
Path parameters
Headers
Request
Id of the time off policy the request consumes: id in GET /org/{organization_slug}/timeoff/policies/. The person must have a balance in that policy unless the policy is unlimited.
First day of the request, YYYY-MM-DD.
Last day of the request, YYYY-MM-DD. Same as start_date for a single day; never before it.
Amount of time requested, in the unit of the policy (quantification: days or hours). For a full-day request on a policy counted in days the amount is recalculated from the dates, skipping holidays and non-working days. For a request by hours or a half day it is taken as sent.
Centralized id of the person the request is for: user.user_id in the time off requests listing, or user.id in GET /org/{organization_slug}/users/user-organizations/. Not the learning user id. Send either user_id or email, not both.
Email of the person the request is for, as an alternative to user_id. It must match exactly (case-insensitive) the email of a user of the organization.
Send true to request hours of a single day on a policy counted in days; value is then a number of hours and start_time / end_time are required.
Start time of a partial-day request, 24-hour HH:MM without time zone. Sent together with end_time, on a single day. Ignored on a full-day request.
End time of a partial-day request, 24-hour HH:MM without time zone; after start_time.
Response
Result code of the operation, namespaced by section — not an HTTP status. The reason of a failed creation travels in the error payload instead.
