Search for departments by name.
At least one of the following permissions is required:
view-livechat-departmentsview-l-room
The conditions field in the selector parameter is deprecated and will be removed in Rocket.Chat 9.0.0. In 8.8, requests containing a non-empty conditions object continue to work, but the response includes deprecation headers and the server records a warning.
Changelog
| Version | Description |
|---|---|
| 8.8.0 | Deprecated the conditions field in the selector parameter. |
The authToken of the authenticated user.
The userId of the authenticated user.
A JSON string containing the search term and an optional array of department IDs to exclude in exceptions. The conditions field is deprecated and will be removed in Rocket.Chat 9.0.0.
Only displays the departments that you are assigned to. The value can be boolean true or false
The result includes archived departments. The value can be Boolean true or false.
OK
{
"departments": [
{
"_id": "qajzu7WaBRoQBpq6Z",
"enabled": true,
"name": "Brazil",
"description": "",
"numAgents": 3,
"showOnRegistration": false,
"showOnOfflineForm": true,
"email": "brazil@rocketchat.com",
"_updatedAt": "2021-06-23T06:02:02.931Z",
"chatClosingTags": [],
"maxNumberSimultaneousChat": "",
"requestTagBeforeClosingChat": false,
"type": "d",
"waitingQueueMessage": "",
"abandonedRoomsCloseCustomMessage": "",
"departmentsAllowedToForward": "",
"offlineMessageChannelName": "",
"visitorInactivityTimeoutInSeconds": "",
"ancestors": []
},
{
"_id": "NhnC9dBwFonZqSQ5m",
"enabled": true,
"name": "CSM and Support",
"description": "",
"showOnRegistration": true,
"showOnOfflineForm": false,
"requestTagBeforeClosingChat": false,
"email": "br@rocketchat.com",
"chatClosingTags": [],
"offlineMessageChannelName": "",
"abandonedRoomsCloseCustomMessage": "",
"waitingQueueMessage": "",
"departmentsAllowedToForward": [
"CAJioQNAvLnYWTy8i",
"Z2KWYBJQFR7AzfmQL"
],
"_updatedAt": "2021-07-12T18:05:53.257Z",
"numAgents": 4
}
],
"count": 2,
"offset": 0,
"total": 2,
"success": true
}Bad Request
{
"success": false,
"error": "The 'selector' param is required"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}