API Reference

/departments/:id/merge

Merges an existing department with a target one in your account. Required scope: w_departments. Accessible with all token types.

Log in to see full request history

Request

An example of the request body:

{ "target_department_id": "3ff4d64b", "force": false }

Results

Calling the POST /departments/:id/merge endpoint will merge the given department with the target department and will return the full department object that is referring to the target department. If resources are affected by this merge, the endpoint will return a 409 error along with a list of those affected resources. To bypass this restriction, the client can set the force parameter to true

{ "id": "3ff4d64b", "name": "HR", "parent_id": null, "sample": false }

Each department will have the following keys:

keytypedescription
idstringThe department identifier
namestringThe name of the department
parent_idstringThe department identifier of the parent department or null if it is a top level department
samplebooleanIndicates whether the department is a sample created department
Path Params
string
required

The account subdomain

string
required

The department id that you want to merge with a target department

Body Params
string
required

The target department identifier that we want the given department id to be merged with

boolean

When false then first will make a check to see if there are any affected resources with this action and then will return error with the affected resources, if any were found. When true then will bypass those affected resources and will proceed to the merge anyway

Responses

Language
Credentials
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json