Retrieve a paginated list of work sites for an organisation.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sitesPath Parameters
The ID of the organisation
Query Parameters
Search by name
Show archived (disabled) work sites
Filter by work_site_id
Current page index
11Number of items per page
20100Response Body
A hash with a data property that contains an item array of up to limit work sites. Each entry in the array is a separate work site object. If there are no more work sites, the resulting array will be empty.
Unique identifier for the work site.
The name of the work site.
The status of the work site.
The number of roster positions at this work site.
Array of HR positions at this work site.
The address of the work site.
Array of departments at this work site. Each entry contains workforce visibility information.
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/work_sites" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "items": [ { "id": "aea965c5-c095-49ea-896e-131bc5c4cf3b", "name": "Test site", "status": "active", "roster_positions_count": 5, "hr_positions": [ { "id": "74aae202-676b-4e8e-8c56-55612ced8e2d", "status": "active", "hr_position_title": { "id": "c44cfdca-7433-46e9-9502-038fa6333dce", "name": "Position" }, "roster_positions_count": 5, "cost_centre": { "id": "0b7ef29a-5172-4437-a6fd-2c9291eb04a9", "name": "AU" }, "color": "smalt", "team_assign_mode": "auto_assign", "team_ids": [ "7d5046b1-b63c-427c-bfdd-917f733e8496" ], "member_ids": [ "fe179bf9-19e3-4779-b458-e2d418127186" ], "roster_positions": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "member_id": "fe179bf9-19e3-4779-b458-e2d418127186" } ] } ], "address": { "address_type": "business", "line_1": "123 Collins Street", "line_2": "Level 5", "line_3": "Building A", "block_number": "123", "level_number": "5", "unit_number": "501", "city": "Melbourne", "postcode": "3000", "state": "VIC", "suburb": "Melbourne", "country": "AU", "is_residential": false, "street_name": "Collins Street" }, "departments": [ { "id": "8ece3e8c-c83f-4388-9fa8-c33b100ede9b", "name": "DevSquad", "assignment_count": 3, "notification_settings": { "check_in_time": "01:00 PM", "check_out_time": "01:15 PM", "days_of_week": [ "Sunday", "Saturday" ] } }, { "id": "8243b4ac-c438-48cc-af5a-f496c76b786d", "name": "New Department", "assignment_count": 0, "notification_settings": { "check_in_time": "12:00 PM", "check_out_time": "12:15 PM", "days_of_week": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] } } ] } ], "page_index": 1, "item_per_page": 20, "total_items": 1, "total_pages": 1 }}Create a work site, and create a default availability status in_office alongside this worksite if an organisation has access to workforce visibility.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sitesPath Parameters
The ID of the organisation
Request Body
The name of the work site
Notes
- Please obtain
longitudeandlatitudefrom a geocoding service (e.g. Google Maps), and use the values for thegeolocationproperty.
Response Body
The created work site object.
Unique identifier for the object.
The name of the work site.
The address of the work site.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } } }'Response
{ "data": { "id": "16a62c0d-bb91-45e4-ad47-a325117c87eb", "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } } }}This endpoint updates a specific work site.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_idPath Parameters
The ID of the organisation
The ID of the work site
Request Body
The name of the work site
Notes
- Please obtain
longitudeandlatitudefrom a geocoding service (e.g. Google Maps), and use the values for thegeolocationproperty.
Response Body
The updated work site object.
Unique identifier for the object.
The name of the work site.
The address of the work site.
Example
curl -X PUT \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_id" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \ -H "Content-Type: application/json" \ -d '{ "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } } }'Response
{ "data": { "id": "16a62c0d-bb91-45e4-ad47-a325117c87eb", "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } } }}Disables a work site along with every work site and HR position beneath it in the hierarchy.
Disabling is idempotent. Disabling a work site that is already disabled returns 200 with no changes.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_id/disablePath Parameters
The ID of the organisation.
The ID of the work site to disable.
Response Body
The disabled work site object, with status set to archived.
Unique identifier for the object.
The name of the work site.
The status of the work site.
The address of the work site.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_id/disable" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "16a62c0d-bb91-45e4-ad47-a325117c87eb", "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } }, "status": "archived" }}Enables a disabled work site along with every work site and HR position beneath it in the hierarchy.
Enabling is idempotent. Enabling a work site that is already active returns 200 with no changes.
https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_id/enablePath Parameters
The ID of the organisation.
The ID of the work site to enable.
Response Body
The enabled work site object, with status set to active.
Unique identifier for the object.
The name of the work site.
The status of the work site.
The address of the work site.
Example
curl -X POST \ "https://api.employmenthero.com/api/v1/organisations/:organisation_id/work_sites/:work_site_id/enable" \ -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"Response
{ "data": { "id": "16a62c0d-bb91-45e4-ad47-a325117c87eb", "name": "Work Site 1", "address": { "line_1": "123 Main St", "line_2": "Apt 4B", "line_3": "Building 5", "country": "US", "postcode": "12345", "city": "New York", "state": "NY", "suburb": "Manhattan", "geolocation": { "latitude": 40.7128, "longitude": -74.006 } }, "status": "active" }}