Create Timeoff requests
/unified/hris/timeoff_requests
Partial response — use the "get" endpoint for the full object.
Query Parameters
Refer Specifying query parameters in Truto APIs
The company to use, referencing companies.id. Optional: when omitted the account's company is looked up automatically. The request fails if the account can see more than one company and none is given.
1 supported
Flat alternative to company.id.
1 supported
Show Truto-specific parameters
The ID of the integrated account to use for the request.
62f44730-dd91-461e-bd6a-aedd9e0ad79dThe format of the response.
unifiedreturns the response with unified mappings applied.rawreturns the unprocessed, raw response from the remote API.normalizedapplies the unified mappings and returns the data in a normalized format.streamreturns the response as a stream, which is ideal for transmitting large datasets, files, or binary data. Using streaming mode helps to efficiently handle large payloads or real-time data flows without requiring the entire data to be buffered in memory.debugreturns the final unified result alongside raw remote fetch information. The response is an envelope containingresult(identical to unified mode output) anddebug(withrequestUrl,requestOptions,data,responseHeaders, and for list operations:nextCursor,isLooping,isEmptyResult,resultCount). When the upstream body exceeds 1 MiB,datais replaced by{ truto_truncated: true, truto_max_bytes, truto_excerpt }.debugisnullfor static responses or whentruto_skip_api_call=true.
Defaults to unified.
unifiedunifiedrawnormalizedstreamdebug
Excludes the remote_data attribute from the response.
Validates the request body against this method's request_body_schema before the request is sent to the underlying integration. When a field marked required is missing, Truto responds 400 with the missing field names under truto_error_insight.missing_required_body_fields instead of forwarding the call. Only the fields documented in request_body_schema are checked. A body carrying a non-empty remote_data object is forwarded unchecked, because remote_data is merged into the provider request and may already carry the required values. A field the mapping always supplies through its default body is treated as present, and a field that is only conditionally required is reported under truto_error_insight.conditionally_required_body_fields rather than rejected. Some integrations declare fields required on update that the provider only requires on create; check meta/{method} for the resource before enabling this on update calls. If you sent an Idempotency-Key and the request was rejected, use a fresh key when you retry with a corrected body: the idempotency cache is keyed on the integrated account, path and key only — it ignores the query string and the body — so reusing the key replays the rejection. Defaults to false, which forwards the request as-is.
Array of fields to exclude from the response.
truto_exclude_fields[]=id&truto_exclude_fields[]=nameQuery parameters to pass to the underlying API without any transformations. Refer this guide to see how to structure the query parameters.
remote_query[foo]=barRequest Body
Refer Writing data using Unified APIs
paidunpaid
1 supported1 required
paidunpaidTotal quantity in the type's unit (hours or days), split evenly over the valid days only, rounded to 4 decimals with the rounding remainder on the last day so the days add up to amount. When omitted, each day gets the daily default quantity Workday reports for the type.
12 supported1 required
The Remote user id recorded as approver (a company manager user id, see approver on timeoff_requests). Defaults to the user who generated the API token. Remote only lets company tokens create already-approved time off.
6 supported
Not a unified field. Explicit list of dates (YYYY-MM-DD) to book instead of the start_time..end_time range.
1 supported
This represents the description of the time off request.
9 supported
1 supported1 required
The employee (employees.id) requesting time off.
19 supported16 required
The unique identifier for employees
This represents the name of the employee.
Flat alternative to employee.id.
1 supported
Comment stored on every day of the request.
9 supported
Deel-specific: the contract the time off is for (employments.id), for workers with several contracts.
1 supported
The last day of the time off (inclusive; the time part is ignored). Defaults to start_time. At most 31 days. Workday creates one time off entry per valid day: the create response describes the first created day only (its start_time, end_time and amount are that day's), and timeoff_requests.list returns one record per day.
19 supported16 required
1 supported1 required
Deel-specific: whether the time off is paid. Defaults to the policy configuration.
1 supported
UKG-specific: the pay code (name or ID) the time off is paid with. Defaults to the subtype's default pay code, which is read first for the employee (one extra call).
1 supported
The time off reason (Workday reason WID) when the type requires one.
6 supported2 required
The unique identifier for timeoff_reason
This represents the name of the timeoff_reason.
Any additional data that should be passed as part of the request body. This data is not transformed by Truto and is passed as is to the remote API.
vacation (default when neither this nor timeoff_type is sent) or absence. Any other value — including vacation_cancellation and absence_cancellation, which timeoff_requests.list returns — is refused with a 400: Sesame has no other kind of request, and Truto never books vacation days for a value it does not understand.
vacationabsence
5 supported2 required
vacationabsenceSingle-day requests only: morning or afternoon books a half day (4 hours).
fullmorningafternoonfullmorningafternoonfullmorningafternoonfullmorningafternoonmorningafternoonfullmorningafternoon+ 5 more
6 supported1 required
morningafternoonfullmorningafternoonfullmorningafternoonThe first day of the time off (the time part is ignored). Before anything is created, every day from start_time to end_time is checked with Workday's validTimeOffDates for this employee and time off type (one extra call), and only the valid days are requested: days Workday does not accept for the type, such as weekends or holidays, are left out.
19 supported18 required
The status HR WORKS stores for the absence. HR WORKS requires it and does not document a default, so Truto refuses the write with a 400 when it is missing rather than choosing one. Accepts the unified values pending (sent as requested), approved (validatedOk), rejected (validatedNotOk) and cancelled, or any HR WORKS AbsenceStatus identifier: substitutionRequested, cancellationRequested, cancelled, changesRequested, editingChanges, deletionRequested, editing, substitutionRejected, requested, validatedOk, validatedNotOk. Case-insensitive; any other value is refused with a 400. Setting an approved status directly (validatedOk) writes the absence as already checked, which skips the approval step a request created as pending would go through in HR WORKS.
pendingapprovedrejectedpendingapproved
14 supported1 required
pendingapprovedrejectedpendingapprovedUKG-specific: the amount type of the period, as the name or ID of one of the tenant's allowed amounts for this employee and subtype (for example Full Day). UKG requires it on every period and does not document the values; list them with the proxy API resource timeoff_symbolic_values (GET /v1/scheduling/timeoff/symbolic_values).
1 supported1 required
Alternative to timeoff_type: the leave policy (timeoff_policies.id).
1 supported
Deel-specific: the time off policy (timeoff_policies.id). Used by Deel in place of timeoff_type.
1 supported
The time off type (timeoff_types.id for the same employee, category Time Off).
16 supported10 required
IANA timezone of the request (Remote requires one; defaults to Etc/UTC).
1 supported
Unit of amount (a day = 8 hours).
hoursdaysweeksmonthshoursdays
12 supported
hoursdaysDeel-specific: whether the request goes through Deel's approval flow, where the worker's approvers review it in Deel. Defaults to true for pending requests and false for approved ones. With false, a pending request can only be reviewed through Deel's API review endpoint, which Truto does not expose.
1 supported
Response Body
The unique identifier for timeoffpolicies
16 supported
This represents the amount of the time off request.
12 supported
This represents the approver of the time off request.
6 supported
This represents the date when the timeoffpolicies was created
9 supported
This represents the description of the time off request.
9 supported
This represents the employee requesting time off.
15 supported
The unique identifier for employees
This represents the name of the employee.
This represents the employee note for the time off request.
9 supported
This represents the end time of the time off request.
15 supported
This represents the reason of the time off request.
5 supported
The unique identifier for timeoff_reason
This represents the name of the timeoff_reason.
Raw data returned from the remote API call.
This represents the request type of the time off request.
4 supported
This represents the session of the time off request.
fullmorningafternoon
6 supported
This represents the start time of the time off request.
15 supported
This represents the status of the time off request.
14 supported
This represents the time off type of the time off request.
13 supported
This represents the units of the time off request.
hoursdaysweeksmonths
12 supported
This represents the date when the timeoffpolicies was updated
8 supported
truto unified hris timeoffrequests \
-m create \
-a '<integrated_account_id>' \
-b '{
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": true,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": true,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": true,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
}' \
-o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const result = await truto.unifiedApi.create(
'hris',
'timeoffrequests',
{
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": true,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": true,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": true,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
},
{ integrated_account_id: '<integrated_account_id>' }
);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
result = await truto_api.unified_api.create(
"hris",
"timeoffrequests",
{
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": True,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": True,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": True,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
},
{"integrated_account_id": "<integrated_account_id>"}
)
print(result)
asyncio.run(main())curl -X POST 'https://api.truto.one/unified/hris/timeoff_requests?integrated_account_id=<integrated_account_id>' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": true,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": true,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": true,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
}'const integratedAccountId = '<integrated_account_id>';
const body = {
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": true,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": true,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": true,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
};
const response = await fetch(`https://api.truto.one/unified/hris/timeoff_requests?integrated_account_id=${integratedAccountId}`, {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/unified/hris/timeoff_requests"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
"integrated_account_id": "<integrated_account_id>"
}
payload = {
"employee": {},
"start_time": "your_start_time",
"end_time": "your_end_time",
"timeoff_type": "your_timeoff_type",
"status": "pending",
"employee_note": "your_employee_note",
"amount": 0,
"description": "your_description",
"request_policy_type": "vacation",
"reason": {},
"session": "full",
"is_paid": True,
"timeoff_policy_id": "your_timeoff_policy_id",
"employment": {},
"use_deel_approval_flow": True,
"approver": "your_approver",
"absence_paid_status": "paid",
"is_emergency_leave": True,
"units": "hours",
"timezone": "your_timezone",
"timeoff_policy": "your_timeoff_policy",
"employee_id": "your_employee_id",
"days": [],
"symbolic_amount": "your_symbolic_amount",
"pay_code": "your_pay_code",
"remote_data": {}
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())