Departments
On this page, you will find descriptions of the API methods intended for working with departments for technicians from the Team section.
Department Management
Department List
You can retrieve a list of all team departments using the team/department/list method.
Request:
| Parameter | Type | Description |
search | string | Case-insensitive filter by department name. |
offset | number | Offset for the first item in the list. Default value: 0 |
limit | number | Number of items in the list. Default value: 20; maximum value: 100 |
Response:
Example Response
Response Data{
"data": [ {
"id": 1001,
"name": "Mobile Support",
"ldap": true,
"worker": false,
"create_time": 1788503133,
"modify_time": 1788503133,
"size": 2
} ]
}
| Name | Type | Description |
data | array | List of departments. |
data[].id | number | Internal department ID. |
data[].name | string | Department name. |
data[].ldap | boolean | Indicates whether the department was imported from an Identity Provider via DAP. |
data[].worker | boolean | Indicates whether the department is intended for workplaces. |
data[].create_time | number | Department creation time as a Unix timestamp. |
data[].modify_time | number | Time of the department's last update as a Unix timestamp. |
data[].size | number | Number of members in the department. |
Department Info
To retrieve detailed information about a department, use the team/department/info method.
Request:
| Parameter | Type | Value |
id | number | Internal department ID |
Response:
Example Response
Response Data{
"data": {
"id": 1001,
"name": "Mobile Support",
"ldap": false,
"worker": false,
"members": [ {
"id": 1002,
"email": "[email protected]"
}, {
"id": 1003,
"email": "[email protected]"
} ]
},
"status": 0
}
| Name | Type | Description |
data | object | Department data. |
data.id | number | Internal department ID. |
data.name | string | Department name. |
data.ldap | boolean | Indicates whether the department was imported from an Identity Provider via LDAP. |
data.worker | boolean | Indicates whether the department is intended for workplaces. |
data.create_time | number | Department creation time as a Unix timestamp. |
data.modify_time | number | Time of the department's last update as a Unix timestamp. |
data.members | array | List of department members. |
data.members[].id | number | Internal member ID. |
data.members[].email | string | Member email address. |
status | number | Result status. Possible values:
0 - Department data found1 - Invalid request2 - Internal server error6 - Department not found8 - Access to the department is denied
|
Create Department
You can create a department within your team using the team/department/create method.
Request:
| Parameter | Type | Description |
name | string | Department name. |
worker | boolean | Indicates whether the department is intended for workplaces. |
Response:
Example Response
Response Data{
"id": 1001,
"status": 0
}
| Name | Type | Description |
id | number | Internal ID of the created department. |
status | number | Result status. Possible values:
0 — Department created successfully.1 — Invalid request data.6 — Insufficient permissions.
|
Update Department
You can update department details using the team/department/update method.
Request:
| Parameter | Type | Description |
id | number | Internal department ID. |
name | string | Department name. |
Response:
Example Response
Response Data{
"status": 0
}
| Name | Type | Description |
status | number | Result status. Possible values:
0 — Data updated successfully.1 — Invalid request data.6 — Insufficient permissions.
|
Remove Department
You can delete a department using the team/department/remove method.
Request:
| Parameter | Type | Description |
id | number | Internal department ID. |
Response:
Example Response
Response Data{
"status": 0
}
| Name | Type | Description |
status | number | Result status. Possible values:
0 — Department deleted successfully.1 — Invalid request data.8 — Insufficient permissions.
|
Department Members
Add Member to Department
To add a technician account or pending invitation to a department, use the team/department/member/add method.
Request:
| Parameter | Type | Description |
id | number | Internal department ID. |
email | string | Email address of the technician or pending invitation. |
Response:
Example Response
Response Data{
"status": 0
}
| Name | Type | Description |
status | number | Result status. Possible values:
0 — Member added successfully.1 — Invalid request data.2 — Internal server error.6 — Department or member not found.6 — Insufficient permissions.
|
Remove Member from Department
To remove a technician account or pending invitation from a department, use the team/department/member/remove method.
Request:
| Parameter | Type | Description |
id | number | Internal department ID. |
email | string | Email address of the technician or pending invitation. |
Response:
Example Response
Response Data{
"status": 0
}
| Name | Type | Description |
status | number | Result status. Possible values:
0 — Member removed successfully.1 — Invalid request data.2 — Internal server error.6 — Department or member not found.6 — Insufficient permissions.
|