Lists the unavailability of the organisation's active contractors within a date window. Requires the Contractor Unavailabilities - Read scope and an organisation admin or owner.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilitiesPath Parameters
The ID of the organisation.
Query Parameters
Start of the date window in YYYY-MM-DD format. Records that overlap the window are returned, including records that start before this date.
End of the date window in YYYY-MM-DD format. Must not be before start_date or more than 366 days after it.
If set, only return unavailability of this contractor. Must be the ID of a contractor in the organisation.
Current page index
11Number of items per page
20100Response Body
A paginated list of contractor unavailability records overlapping the requested window. A recurring series appears as one item per occurrence date, all sharing the same id, and total_items counts these expanded items.
Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.
ID of the contractor the unavailability belongs to.
The full name of the contractor the unavailability belongs to. Null when the contractor cannot be found. This field is rolled out gradually and may not yet appear for every organisation.
The first day of the unavailability in YYYY-MM-DD format.
The last day of the unavailability in YYYY-MM-DD format (inclusive).
true if the contractor is unavailable for the whole day. false for a partial-day unavailability, which runs from start_time to end_time on each day of the range.
The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.
The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.
true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.
Optional description of the unavailability.
The status of the record. Always unavailable.
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/contractor_unavailabilities" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "items": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e", "member_name": "Alex Example", "start_date": "2027-06-01", "end_date": "2027-06-10", "all_day": true, "start_time": null, "end_time": null, "recurring": false, "description": "School holidays", "status": "unavailable" } ], "page_index": 1, "item_per_page": 20, "total_items": 1, "total_pages": 1 }}Retrieves a single contractor unavailability record by ID. Requires the Contractor Unavailabilities - Read scope and an organisation admin or owner.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_idPath Parameters
The ID of the organisation.
The ID of the contractor unavailability.
Response Body
The requested contractor unavailability record.
Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.
ID of the contractor the unavailability belongs to.
The full name of the contractor the unavailability belongs to. Null when the contractor cannot be found. This field is rolled out gradually and may not yet appear for every organisation.
The first day of the unavailability in YYYY-MM-DD format.
The last day of the unavailability in YYYY-MM-DD format (inclusive).
true if the contractor is unavailable for the whole day. false for a partial-day unavailability, which runs from start_time to end_time on each day of the range.
The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.
The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.
true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.
Optional description of the unavailability.
The status of the record. Always unavailable.
Example
curl -X GET \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e", "member_name": "Alex Example", "start_date": "2027-06-01", "end_date": "2027-06-10", "all_day": true, "start_time": null, "end_time": null, "recurring": false, "description": "School holidays", "status": "unavailable" }}Creates an all-day or partial-day unavailability for an active contractor. For a partial-day unavailability, set all_day to false and send start_time and end_time. Partial-day creates are checked against the organisation's minimum notice period and overlap rules. Requires the Contractor Unavailabilities - Create scope and an organisation admin or owner. The change is recorded in the contractor's audit trail.
Not idempotent
Sending the same request twice creates two records, and a request that times out may still have been processed. Recurring unavailability cannot be created.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilitiesPath Parameters
The ID of the organisation.
Request Body
The ID of an active contractor in the organisation.
The first day of the unavailability in YYYY-MM-DD format.
The last day of the unavailability in YYYY-MM-DD format (inclusive). Must not be before start_date or more than 366 days after it.
Defaults to true. Set to false for a partial-day unavailability from start_time to end_time on each day of the range. The whole range is stored as one record.
Start time of each day in the range, in zero-padded 24-hour HH:MM format, for example 09:00. Wall-clock time in the organisation's local time, with no timezone conversion. Required when all_day is false; must be omitted when all_day is true.
End time of each day in the range, in zero-padded 24-hour HH:MM format, for example 12:00. Wall-clock time in the organisation's local time, with no timezone conversion. Must be after start_time. Required when all_day is false; must be omitted when all_day is true.
Optional description. Maximum 500 characters.
Response Body
The newly created contractor unavailability record.
Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.
ID of the contractor the unavailability belongs to.
The full name of the contractor the unavailability belongs to. Null when the contractor cannot be found. This field is rolled out gradually and may not yet appear for every organisation.
The first day of the unavailability in YYYY-MM-DD format.
The last day of the unavailability in YYYY-MM-DD format (inclusive).
true if the contractor is unavailable for the whole day. false for a partial-day unavailability, which runs from start_time to end_time on each day of the range.
The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.
The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.
true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.
Optional description of the unavailability.
The status of the record. Always unavailable.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e", "start_date": "2027-06-01", "end_date": "2027-06-03", "all_day": false, "start_time": "09:00", "end_time": "12:00", "description": "Medical appointments" }'Response
{ "data": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e", "member_name": "Alex Example", "start_date": "2027-06-01", "end_date": "2027-06-03", "all_day": false, "start_time": "09:00", "end_time": "12:00", "recurring": false, "description": "Medical appointments", "status": "unavailable" }}Updates the dates, times, all_day and/or description of a non-recurring contractor unavailability, which can be all-day or partial-day; at least one field is required. Recurring records cannot be updated. Fields you omit keep their stored values, so a date-only or description-only update keeps the times of a partial-day record. Updates are not checked against the minimum notice period or for overlaps, and the last write wins. Malformed times are rejected as invalid requests, and other rule breaches as validation errors (see Errors). Requires the Contractor Unavailabilities - Update scope and an organisation admin or owner. The change is recorded in the contractor's audit trail.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_idPath Parameters
The ID of the organisation.
The ID of the contractor unavailability to update.
Request Body
The revised first day in YYYY-MM-DD format. Cannot be null. If end_date is omitted, the existing end date is kept.
The revised last day in YYYY-MM-DD format (inclusive). Cannot be null. If start_date is omitted, the existing start date is kept. The resulting end_date must not be before start_date or more than 366 days after it.
Set to false to make the record partial-day; start_time and end_time must then be sent, or already be stored on the record. Set to true to make it all-day, which clears the times. Cannot be null.
Start time of each day in the range, in zero-padded 24-hour HH:MM format, for example 09:00. Wall-clock time in the organisation's local time, with no timezone conversion. Can be sent on its own, keeping the stored end time. Rejected for an all-day record unless all_day is false in the same request. Cannot be null.
End time of each day in the range, in zero-padded 24-hour HH:MM format, for example 12:00. Wall-clock time in the organisation's local time, with no timezone conversion. Must be after the start time, whether sent or stored. Can be sent on its own, keeping the stored start time. Rejected for an all-day record unless all_day is false in the same request. Cannot be null.
The revised description. Maximum 500 characters. Send an empty string to clear it; null is rejected.
Response Body
The updated contractor unavailability record.
Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.
ID of the contractor the unavailability belongs to.
The full name of the contractor the unavailability belongs to. Null when the contractor cannot be found. This field is rolled out gradually and may not yet appear for every organisation.
The first day of the unavailability in YYYY-MM-DD format.
The last day of the unavailability in YYYY-MM-DD format (inclusive).
true if the contractor is unavailable for the whole day. false for a partial-day unavailability, which runs from start_time to end_time on each day of the range.
The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.
The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.
true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.
Optional description of the unavailability.
The status of the record. Always unavailable.
Example
curl -X PATCH \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "start_time": "10:00", "end_time": "13:00", "description": "Medical appointments (rescheduled)" }'Response
{ "data": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e", "member_name": "Alex Example", "start_date": "2027-06-01", "end_date": "2027-06-03", "all_day": false, "start_time": "10:00", "end_time": "13:00", "recurring": false, "description": "Medical appointments (rescheduled)", "status": "unavailable" }}Deletes a contractor unavailability record. Requires the Contractor Unavailabilities - Delete scope and an organisation admin or owner. The change is recorded in the contractor's audit trail.
Recurring unavailability
Do not delete recurring unavailability through this API. Manage it in the Employment Hero web app.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_idPath Parameters
The ID of the organisation.
The ID of the contractor unavailability to delete.
Response Body
Returns HTTP 204 No Content on success. Deleting the same ID again fails because the record no longer exists.
Example
curl -X DELETE \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
This endpoint does not return a response body.