API Reference
API Reference

/departments

Updates an existing department in your account. Required scope: w_departments. Accessible with all token types.

Request

An example of the request body:

{
    "id": "3ff4d641",
    "name": "New Commercial name",
    "parent_id": "3ff4d64b"
}

Rename a department

In order to rename an existing department, the full body should be sent by changing only the name.

Change parent of the department

In order to change the department's parent, then the new provided id it should be in the parent_idfield. In cases that the parent_id is null then the department become a root department.

Results

Calling the PUT /departments endpoint will update the given department and return it. An example of the response follows:

{
    "id": "3ff4d641",
    "name": "New Commercial name",
    "parent_id": "3ff4d64b",
    "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
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!