Employment Hero LogoEmployment Hero

Contractor Unavailability

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.

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

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

Query Parameters

start_datestringrequired

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_datestringrequired

End of the date window in YYYY-MM-DD format. Must not be before start_date or more than 366 days after it.

member_iduuid

If set, only return unavailability of this contractor. Must be the ID of a contractor in the organisation.

page_indexnumber

Current page index

Default1
Min1
item_per_pagenumber

Number of items per page

Default20
Max100

Response 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.

dataobject
itemsobject[]
iduuid

Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.

member_iduuid

ID of the contractor the unavailability belongs to.

member_namestring

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.

start_datestring

The first day of the unavailability in YYYY-MM-DD format.

end_datestring

The last day of the unavailability in YYYY-MM-DD format (inclusive).

all_dayboolean

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.

start_timestring

The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.

end_timestring

The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.

recurringboolean

true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.

descriptionstring

Optional description of the unavailability.

statusenum<string>

The status of the record. Always unavailable.

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/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.

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

contractor_unavailability_iduuidrequired

The ID of the contractor unavailability.

Response Body

The requested contractor unavailability record.

dataobject
iduuid

Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.

member_iduuid

ID of the contractor the unavailability belongs to.

member_namestring

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.

start_datestring

The first day of the unavailability in YYYY-MM-DD format.

end_datestring

The last day of the unavailability in YYYY-MM-DD format (inclusive).

all_dayboolean

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.

start_timestring

The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.

end_timestring

The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.

recurringboolean

true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.

descriptionstring

Optional description of the unavailability.

statusenum<string>

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.

POST
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

Request Body

member_iduuidrequired

The ID of an active contractor in the organisation.

start_datestringrequired

The first day of the unavailability in YYYY-MM-DD format.

end_datestringrequired

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.

all_dayboolean

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_timestring

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_timestring

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.

descriptionstring

Optional description. Maximum 500 characters.

Response Body

The newly created contractor unavailability record.

dataobject
iduuid

Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.

member_iduuid

ID of the contractor the unavailability belongs to.

member_namestring

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.

start_datestring

The first day of the unavailability in YYYY-MM-DD format.

end_datestring

The last day of the unavailability in YYYY-MM-DD format (inclusive).

all_dayboolean

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.

start_timestring

The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.

end_timestring

The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.

recurringboolean

true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.

descriptionstring

Optional description of the unavailability.

statusenum<string>

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.

PATCH
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

contractor_unavailability_iduuidrequired

The ID of the contractor unavailability to update.

Request Body

start_datestring

The revised first day in YYYY-MM-DD format. Cannot be null. If end_date is omitted, the existing end date is kept.

end_datestring

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.

all_dayboolean

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_timestring

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_timestring

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.

descriptionstring

The revised description. Maximum 500 characters. Send an empty string to clear it; null is rejected.

Response Body

The updated contractor unavailability record.

dataobject
iduuid

Unique identifier of the unavailability. Occurrences of a recurring unavailability share the same ID.

member_iduuid

ID of the contractor the unavailability belongs to.

member_namestring

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.

start_datestring

The first day of the unavailability in YYYY-MM-DD format.

end_datestring

The last day of the unavailability in YYYY-MM-DD format (inclusive).

all_dayboolean

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.

start_timestring

The time of day (HH:MM) when a partial-day unavailability begins. null when all_day is true.

end_timestring

The time of day (HH:MM) when a partial-day unavailability ends. null when all_day is true.

recurringboolean

true if the record is, or is one occurrence of, a recurring unavailability. The recurrence pattern itself is not returned.

descriptionstring

Optional description of the unavailability.

statusenum<string>

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.

DELETE
https://api.employmenthero.com/api/v1/organisations/:organisation_id/contractor_unavailabilities/:contractor_unavailability_id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

contractor_unavailability_iduuidrequired

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.