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.

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. Records created through this API are always all-day.

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",        "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.

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. Records created through this API are always all-day.

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",    "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 unavailability for an active contractor. 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. Partial-day and 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. Only true is supported; false is rejected.

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.

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. Records created through this API are always all-day.

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-10",    "all_day": true,    "description": "School holidays"  }'

Response

{  "data": {    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e",    "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"  }}

Updates the dates and/or description of an all-day, non-recurring contractor unavailability; at least one field is required. Recurring and partial-day records cannot be updated, and the last write wins. 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.

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.

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. Records created through this API are always all-day.

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 '{    "end_date": "2027-06-12",    "description": "School holidays (extended)"  }'

Response

{  "data": {    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "member_id": "6ddbfb24-8153-42a9-9248-c41c9b6c755e",    "start_date": "2027-06-01",    "end_date": "2027-06-12",    "all_day": true,    "start_time": null,    "end_time": null,    "recurring": false,    "description": "School holidays (extended)",    "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.