How can we help you?

Sync Offices and Departments from an External System

site_admin_all.png

It is possible to add new Offices and Departments through the Harvest API. However, Offices and Departments are organization-level fields that can be tied to permissions, approval chains, jobs, custom fields, template jobs, and more. Due to these dependencies, there are some limitations on how Offices and Departments can be updated through the API. In this article, we will cover the actions you can take to add or update Offices and Departments in Greenhouse using an integration with a third-party system.

For more information on these dependencies, please see: Office and Department Dependent Workflows in Greenhouse.

 

Possible Actions with the API

You can add new Offices and Departments as a parent or child Office or Department with the following API endpoints.

Note: If you are importing these values from an HCM or other third-party system, we recommend including an External ID value.

If you are adding a child Office or Department, you will need to use the Greenhouse ID to specify the parent Office or Department ID in the “parent_id” field. For example:

curl -X POST \
https://harvest.greenhouse.io/v1/departments \
-H 'Authorization: Basic ***********************' \
-H 'Content-Type: application/json' \
-H 'On-Behalf-Of: 642569' \
-d '{
"name": "NewChildDepartment",
"parent_id": 45819,
"external_id": "ABC123"
}'
 

Update existing Office Names, Locations, or External IDs and existing Department names or External IDs via the following endpoints:

You will need to use the Greenhouse Office or Department ID in the HTTP request in order to specify the appropriate Office/Department to update. For example, the following would update the Office with the Greenhouse ID 63683:

curl -X PATCH \
https://harvest.greenhouse.io/v1/offices/63683 \
-H 'Authorization: Basic ***********************' \
-H 'Content-Type: application/json' \
-H 'on-behalf-of: 642569' \
-d '{
"name": "Updated Office Name",
"location": "New York, NY",
"external_id": "ABC123456"
}'

 

Not Possible Actions with the API

  • Removing Offices or Departments (not recommended in general for the purpose of preserving historical job data)
  • Updating Office or Department hierarchy (for example, you can not make a subordinate Office a parent Office through the API - see screenshot below)

sdfgh.png