Skip to content
Log in Request a demo

Time Off

The /api/v1/time-off endpoint group lets you read the organization’s leave policy configuration, the accrual/usage history for each employee, and their current balance as of any date.

GET /api/v1/time-off/categories

Returns all time-off policies/categories configured for the organization.

Response fields (per category):

FieldTypeDescription
idintegerCategory ID
titlestringName
descriptionstringDescription
category_typestringType: manual, accrues_time, flexible
paid_typestringPaid/unpaid classification
period_track_typestringTracking unit: hours or days
emojistringEmoji icon
colorstringColor
policies_countintegerNumber of attached policies
is_archivedbooleanWhether the category is archived
is_parental_leavebooleanWhether this is a parental leave category

Response example:

[
{
"id": 3,
"title": "Annual Paid Leave",
"category_type": "accrues_time",
"paid_type": "paid",
"period_track_type": "days",
"policies_count": 2,
"is_archived": false,
"is_parental_leave": false
}
]

POST /api/v1/time-off/logs/search

Returns a paginated list of leave records - accruals, usages, expirations, and adjustments.

Request parameters:

FieldTypeDescription
employee_idintegerEmployee ID (required)
page_numberintegerPage number
category_idsarray[integer]Filter by category IDs
action_typesarray[string]Types: accrual, used, expired, adjustment
request_statusesarray[string]Filter by approval request statuses

Response fields (per record):

Each record contains two objects: time_off_log and, when a request exists, approval_request_details.

time_off_log:

FieldTypeDescription
idintegerRecord ID
date_adjustmentstring (date)Adjustment date
employee_idintegerEmployee ID
categoryobjectTime-off category
balancestringBalance change
actionstringAction type
balance_typestringBalance type
date_fromstringLeave period start
date_tostringLeave period end
date_expirestringAccrual expiration date
commentstringComment
filesarrayAttached files

approval_request_details (when a request exists):

FieldTypeDescription
idintegerRequest ID
typestringRequest type
statusstringRequest status
confirmationsarrayList of approvals
datetime_created_atstringCreation timestamp

Request example:

{
"employee_id": 123,
"page_number": 1,
"action_types": ["used", "accrual"],
"category_ids": [3, 5]
}

POST /api/v1/time-off/employee/balance

Returns the balance for all time-off categories the employee is enrolled in, as of the specified date.

Request parameters:

FieldTypeDescription
employee_idintegerEmployee ID (required)
date_balancestring (date)Date for which to retrieve the balance (required)

Response fields (per category):

FieldTypeDescription
idintegerCategory ID
titlestringCategory name
category_typestringCategory type
period_track_typestringTracking unit
balance.available_balancestringAvailable balance
balance.total_booked_amountstringBooked amount (approved requests)
is_archivedbooleanWhether the category is archived

Request example:

{
"employee_id": 123,
"date_balance": "2024-06-30"
}

Response example:

[
{
"id": 3,
"title": "Annual Paid Leave",
"category_type": "accrues_time",
"period_track_type": "days",
"balance": {
"available_balance": "12.5",
"total_booked_amount": "3.0"
},
"is_archived": false
}
]

Goal: periodically sync leave data with a payroll system.

  1. Get categories (once, cache the result):

    GET /api/v1/time-off/categories
  2. Fetch history for the period for each employee:

    POST /api/v1/time-off/logs/search

    Filter by action_types: ["used", "accrual"] and the relevant category_ids.

  3. Get the current balance as of the end of the pay period:

    POST /api/v1/time-off/employee/balance

    Pass date_balance as the cutoff date.

Tip: use date_adjustment from time_off_log for incremental sync - only fetch records with an adjustment date later than your last successful sync.