Retrieve a paginated list of departments for an organisation, across all work sites and including both active and disabled departments. Requires the Departments View permission (or admin/owner access).
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departmentsPath Parameters
The ID of the organisation
Query Parameters
Current page index
11Number of items per page
20100Response Body
A paginated list of departments for the organisation.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
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/departments" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "items": [ { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } } ], "page_index": 1, "item_per_page": 20, "total_items": 1, "total_pages": 1 }}Retrieve a single department by its identifier, whether it is active or disabled. Requires the Departments View permission (or admin/owner access).
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_idPath Parameters
The ID of the organisation
The ID of the department
Response Body
The requested department object.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
Example
curl -X GET \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } }}Create a new department for a work site. The department can include notification settings for clock-in and clock-out times, and can have specific members assigned to it.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departmentsPath Parameters
The ID of the organisation
Request Body
UUID of an existing work site
Department name
Clock-in time (e.g., "09:00", "9:00 AM")
Clock-out time (e.g., "17:00", "5:00 PM")
Days of week
Array of member UUIDs to assign to the department
Response Body
The created department object.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "work_site_id": "bdf48551-d061-45d2-b30f-9d78279f0707", "name": "Engineering Department", "clock_in_time": "09:00", "clock_out_time": "17:00", "days_applied": [ "Monday", "Tuesday", "Wednesday" ], "member_ids": [ "5388432b-2aa1-46b3-ad8c-f7c46356bb56", "032de036-9597-4119-be86-8602c3e2e363" ] }'Response
{ "data": { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } }}Update an existing department. You can modify the department name, notification settings for clock-in and clock-out times, and manage member assignments by adding or removing members from the department.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_idPath Parameters
The ID of the organisation
The ID of the department
Request Body
Department name
Clock-in time (e.g., "09:00", "9:00 AM")
Clock-out time (e.g., "17:00", "5:00 PM")
Days of week
Array of member UUIDs to assign to the department
Response Body
The updated department object.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
Example
curl -X PATCH \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "name": "Engineering Department", "clock_in_time": "09:00", "clock_out_time": "17:00", "days_applied": [ "Monday", "Tuesday", "Wednesday" ], "member_ids": [ "5388432b-2aa1-46b3-ad8c-f7c46356bb56", "032de036-9597-4119-be86-8602c3e2e363" ] }'Response
{ "data": { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } }}Disable a department by setting its status to disabled. This request takes no body and is idempotent: calling it on a department that is already disabled succeeds and returns the department unchanged. Requires the Departments Modify permission (or admin/owner access).
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id/disablePath Parameters
The ID of the organisation
The ID of the department
Response Body
The department with its updated status.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id/disable" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } }}Enable a department by setting its status to active. This request takes no body and is idempotent: calling it on a department that is already active succeeds and returns the department unchanged. Requires the Departments Modify permission (or admin/owner access).
https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id/enablePath Parameters
The ID of the organisation
The ID of the department
Response Body
The department with its updated status.
Unique identifier for the object.
The name of the department.
Whether the department is active or disabled.
The number of employees assigned to this department.
Notification settings for this department.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/departments/:department_id/enable" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "5b7cf013-9c7c-417b-abd7-ca1d5a8eb313", "name": "Engineering Department", "status": "active", "assignment_count": 2, "notification_settings": { "check_in_time": "09:00 AM", "check_out_time": "05:00 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday" ] } }}