PKCE mandatory from 2026-09-14 Details
Employment Hero LogoEmployment Hero

Unavailability

Get all unavailability records satisfying the provided conditions

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilities

Path Parameters

organisation_iduuidrequired

ID of the organisation

Query Parameters

from_datestring

Unavailabilities must end on or after this date to be returned. Maximum search range is 1 month.

to_datestring

Unavailabilities must end on or before this date to be returned. Maximum search range is 1 month.

location_idnumber

ID of the cost centre. If specified, only unavailabilities of members in this cost centre are returned.

member_iduuid

If set, only return unavailabilities of this member

page_indexnumber

Current page index

Default1
Min1
item_per_pagenumber

Number of items per page

Default20
Max100

Response Body

The unavailabilities matching the specified conditions

dataobject
itemsobject[]
iduuid

ID of the unavailability

member_iduuid

ID of the member being unavailable

descriptionstring

Reason for the unavailability

all_dayboolean

true if the person is unavailable for the whole day. If false, the unavailable time range will be specified by start_time_a_day and end_time_a_day.

start_datestring

The start date of the unavailability in ISO-8601 format (inclusive)

end_datestring

The end date of the unavailable in ISO-8601 format (inclusive)

start_time_a_daystring

The time within a day (in HH:mm format) when the person unavailability begins.

Before this time, the person is considered available. If start_time_a_day is 06:00, that person is considered available from 00:00 to 05:59. If all_day is true, this field will be null.

end_time_a_daystring

The time within a day (in HH:mm format) when the person unavailability ends.

After this time, the person is considered available. If end_time_a_day is 18:00, that person is considered available from 18:01 to 23:59. If all_day is true, this field will be null.

recurring_patternobject

If null, it represents a single-day unavailability, so start_date and end_date are the same. If present, this specifies which days in the date range is unavailable.

For example: With 2024-01-01 (Monday) and 2024-01-08 as start_date and end_date respectively, a recurring pattern with MON and TUE as weekdays means that member is only unavailable on 1/1/2024 (Monday) and 2/1/2024 (Tuesday). Although 3/1/2024 is in the specified date range, it does not match the recurring pattern, so it is not part of this unavailability. If we change the search range to 2024-01-03 and 2024-01-08, we won't see the record above returned.

page_indexnumber

Current page index

Default1
Min1
item_per_pagenumber

Number of items per page

Default20
Max100
total_itemsnumber

Total items

total_pagesnumber

Total pages

Example

curl -X GET \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilities" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

{  "data": {    "items": [      {        "id": "a66ac7a8-61be-4acb-9147-9908e5b12dbd",        "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e",        "description": "Example description",        "all_day": false,        "start_date": "2024-01-01",        "end_date": "2024-01-02",        "start_time_a_day": "09:00",        "end_time_a_day": "12:00",        "recurring_pattern": {          "recurring_type": "weekly",          "weekdays": [            "MON"          ]        }      }    ],    "page_index": 1,    "item_per_page": 20,    "total_items": 1,    "total_pages": 1  }}

Get unavailability record using its ID

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilities/:id

Path Parameters

organisation_iduuidrequired

ID of the organisation

iduuidrequired

ID of the unavailability record

Response Body

The unavailability record

dataobject
iduuid

ID of the unavailability

member_iduuid

ID of the member being unavailable

descriptionstring

Reason for the unavailability

all_dayboolean

true if the person is unavailable for the whole day. If false, the unavailable time range will be specified by start_time_a_day and end_time_a_day.

start_datestring

The start date of the unavailability in ISO-8601 format (inclusive)

end_datestring

The end date of the unavailable in ISO-8601 format (inclusive)

start_time_a_daystring

The time within a day (in HH:mm format) when the person unavailability begins.

Before this time, the person is considered available. If start_time_a_day is 06:00, that person is considered available from 00:00 to 05:59. If all_day is true, this field will be null.

end_time_a_daystring

The time within a day (in HH:mm format) when the person unavailability ends.

After this time, the person is considered available. If end_time_a_day is 18:00, that person is considered available from 18:01 to 23:59. If all_day is true, this field will be null.

recurring_patternobject

If null, it represents a single-day unavailability, so start_date and end_date are the same. If present, this specifies which days in the date range is unavailable.

For example: With 2024-01-01 (Monday) and 2024-01-08 as start_date and end_date respectively, a recurring pattern with MON and TUE as weekdays means that member is only unavailable on 1/1/2024 (Monday) and 2/1/2024 (Tuesday). Although 3/1/2024 is in the specified date range, it does not match the recurring pattern, so it is not part of this unavailability. If we change the search range to 2024-01-03 and 2024-01-08, we won't see the record above returned.

Example

curl -X GET \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilities/:id" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

{  "data": {    "id": "a66ac7a8-61be-4acb-9147-9908e5b12dbd",    "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e",    "description": "Example description",    "all_day": false,    "start_date": "2024-01-01",    "end_date": "2024-01-02",    "start_time_a_day": "09:00",    "end_time_a_day": "12:00",    "recurring_pattern": {      "recurring_type": "weekly",      "weekdays": [        "MON"      ]    }  }}