Leave Types Resource

The following requests are supported for operations with leave types via actiTIME API:

GET/leaveTypes/{id}
GET/leaveTypes

Leave Type Properties

Leave type properties available via API:

Property Description
id Unique leave type identifier.
name Leave type name.
balance Leave balance that is affected by a leave type. Possible values:

  • pto (leave type affects PTO balance),
  • sick (leave type affects Sick Days balance),
  • none (leave type doesn’t affect any balance).
rateFactor Coefficient used for calculating personal leave types rates.
archived Leave type status. Possible values: false (active), true (archived).

Retrieve Leave Type Properties

Use the following request to retrieve properties of the leave type with given ID:

GET/leaveTypes/{id}

Example Request:

curl -X GET "<actiTIME URL>/api/v1/leaveTypes/1" -H "accept: application/json; charset=UTF-8" -u "username:password"

Example Response:

{
  "id": 1,
  "name": "Sick Leave",
  "balance": "Sick",
  "rateFactor": 1,
  "archived": false
}

More info on using this request is available in Swagger at the following URL:
<your actiTIME URL>/api/v1/swagger

Retrieve List of Leave Types

Use the following request to retrieve a list of leave types with their properties:

GET/leaveTypes

The request can be specified with several parameters:

Parameter Description
offset Pagination offset.
If provided, first n leave types will be not shown in the list.
limit Pagination limit.
If provided, the number of returned leave types will be limited to n.
If not provided, the default value (1000) is used.
ids If provided, only leave types with given IDs will be returned.
name If provided, only the leave type with exact name match will be returned.
words If provided, only leave types containing all given words in their names will be returned.
balance If provided, leave types will be returned that affect PTO Balance only, Sick Days Balance only, or none of the balances only.
If not provided, all leave types will be returned.
archived If provided, only active or only archived leave types will be returned.
If not provided, both active and archived leave types will be returned.
sort Sets sorting of the results.
Leave types can be sorted by name only.

Example Request:

curl -X GET "<actiTIME URL>/api/v1/leaveTypes?limit=3&sort=%2Bname" -H "accept: application/json; charset=UTF-8" -u "username:password"

Example Response:

{
  "offset": 0,
  "limit": 3,
  "items": [
    {
      "id": 9,
      "name": "Business Trip",
      "balance": "None",
      "rateFactor": 1,
      "archived": false
    },
    {
      "id": 1,
      "name": "Sick Leave",
      "balance": "Sick",
      "rateFactor": 1,
      "archived": false
    },
    {
      "id": 2,
      "name": "Time Off",
      "balance": "PTO",
      "rateFactor": 0.5,
      "archived": false
    }
  ]
}

More info on using this request is available in Swagger at the following URL:
<your actiTIME URL>/api/v1/swagger