Get all unavailability records satisfying the provided conditions
https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilitiesPath Parameters
ID of the organisation
Query Parameters
Unavailabilities must end on or after this date to be returned. Maximum search range is 1 month.
Unavailabilities must end on or before this date to be returned. Maximum search range is 1 month.
ID of the cost centre. If specified, only unavailabilities of members in this cost centre are returned.
If set, only return unavailabilities of this member
Current page index
11Number of items per page
20100Response Body
The unavailabilities matching the specified conditions
ID of the unavailability
ID of the member being unavailable
Reason for the unavailability
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.
The start date of the unavailability in ISO-8601 format (inclusive)
The end date of the unavailable in ISO-8601 format (inclusive)
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.
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.
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.
Current page index
11Number of items per page
20100Total items
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
https://api.employmenthero.com/api/v1/organisations/:organisation_id/unavailabilities/:idPath Parameters
ID of the organisation
ID of the unavailability record
Response Body
The unavailability record
ID of the unavailability
ID of the member being unavailable
Reason for the unavailability
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.
The start date of the unavailability in ISO-8601 format (inclusive)
The end date of the unavailable in ISO-8601 format (inclusive)
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.
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.
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" ] } }}