time-off

Find time off

Retrieves a list of all resources from the service.

get/time-off

Request

  • Base URL: https://api.hoorayhr.io
  • URL: https://api.hoorayhr.io/time-off
  • Auth: API key in header authorization

Query parameters

timeOffType'HOLIDAY' | 'LEAVE' | 'OVERTIME_NONE' | 'OVERTIME_PAYOUT' | 'OVERTIME_TIME_OFF_IN_LIEU' | 'TRANSACTION_SPENT' | 'TRANSACTION_LEGACY' | 'TRANSACTION_CORRECTION'
Example:LEAVE

Use the exact query from the example to fetch all leave items.

Response

success

idinteger

ID of the time-off item

userIdinteger required

Unique id of the user.

isPrivateinteger

Tiny-int indicating if the time-off item is private

budgetCalculatedinteger

The calculated time for a time-off item in hours

budgetAdjustmentinteger

When the time-off item is a mutation, this value indicates the amount of time that should be subtracted or added to the user's budget. Time in hours.

budgetTotalinteger

The total time-off budget of a user in hours for this year

isNotCalculatedinteger

Tiny-int indicating if the time should be subtracted from the user's budget

notesstring long-text nullable

Optional text field for mentioning a reason for the time-off request

startstring date-time required

Start date and time of the time-off in JS DateTime format

endstring date-time required

End date and time of the time-off in JS DateTime format

pauseinteger nullable

Applies to hours module only. Pause time in minutes

statusinteger

Status of the time-off item. 1 = "REQUESTED", 2 = "DENIED", 3 = "APPROVED", 4 = "WITHDRAWN"

leaveTypeIdinteger nullable

ID of the corresponding leave type. Can be null in case of holidays

leaveTypeRuleIdinteger nullable

ID of the corresponding leave type rule. Can be null if item does not correspond to a specific rule.

timeOffType'HOLIDAY' | 'LEAVE' | 'OVERTIME_NONE' | 'OVERTIME_PAYOUT' | 'OVERTIME_TIME_OFF_IN_LIEU' | 'TRANSACTION_SPENT' | 'TRANSACTION_LEGACY' | 'TRANSACTION_CORRECTION' required

Enum describing the type of time off item.

leaveUnit'PARTIAL_DAY' | 'FULL_DAY' | 'HALF_DAY' | 'MULTIPLE_DAYS'

The unit of the time off item

integrationCategoryIdinteger nullable

ID of the integration category associated with the time-off item.

holidayIdinteger nullable

If the time-off item was created from a holiday, this value indicates the id of the holiday

labelIdsinteger[] nullable

List of id's belonging to labels

timezonestring required

The time zone of the time-off item. This will automatically be set to the time zone of the provided user through the "userId" field. Use the time-zones endpoint to fetch all supported timezones.

createdAtstring date-time

Creation date of the time-off item

updatedAtstring date-time

Last updated date of the time-off item

userIdApprovedinteger nullable

Unique ID of the user that approved the time-off item

replystring long-text nullable

Optional text with reason for approval/denial of the time-off request

Example response

[
  {
    "id": 5,
    "userId": 1,
    "budgetCalculated": 8,
    "budgetAdjustment": 2,
    "budgetTotal": 480,
    "notes": "I would like to attend the wedding of my sister",
    "start": "2022-02-15T14:01:17.516Z",
    "end": "2022-02-15T18:01:17.516Z",
    "pause": 30,
    "tags": [
      {
        "id": 2,
        "name": "Hours",
        "archived": null
      }
    ],
    "status": 1,
    "leaveTypeId": 1,
    "leaveTypeRuleId": 2,
    "timeOffType": "LEAVE",
    "labelIds": [
      1,
      2,
      3
    ],
    "labels": [
      {
        "id": 5,
        "name": "Long term leave",
        "type": "LEAVE",
        "systemCategoryType": "car",
        "createdAt": "2022-02-23T14:01:17.516Z",
        "updatedAt": "2022-02-23T14:01:17.516Z"
      }
    ],
    "timezone": "Europe/Amsterdam",
    "createdAt": "2022-02-15T14:01:17.516Z",
    "updatedAt": "2022-02-23T14:01:17.516Z",
    "userIdApproved": 3,
    "reply": "Enjoy the wedding!"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.