Get Available Departments by Unit Id

Gets all the available departments.

HTTP MethodURLRequires Auth

GET

/api/v1/livechat/units/:unitId/departments/available

Permission required: manage-livechat-units

Path Variables

KeyExample ValueDescription

unitId*

sriw2wmP2Zz2pPrre

The unit ID.

Query Parameters

This endpoint supports the optional count and offset Pagination parameters. Additional optional parameters are as follows:

KeyExample ValueDescription

text

test

The text with which you want to filter the result.

onlyMyDepartments

true

Displays the departments that you are part of.

Example Call

curl --location --request GET 'http://localhost:3000/api/v1/livechat/units/TGjc7wN84KxQup9cF/departments/available' \
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'

Example Response

{
    "departments": [
        {
            "_id": "Yi87Ju7eTHiZQ7CJt",
            "enabled": false,
            "name": "Customer Success",
            "description": "TEST",
            "showOnRegistration": false,
            "showOnOfflineForm": true,
            "requestTagBeforeClosingChat": false,
            "email": "",
            "maxNumberSimultaneousChat": "",
            "waitingQueueMessage": "TEST",
            "type": "d",
            "numAgents": 13,
            "_updatedAt": "2021-06-28T22:10:01.360Z",
            "ancestors": [
                "sriw2wmP2Zz2pPrre"
            ],
            "chatClosingTags": [],
            "abandonedRoomsCloseCustomMessage": "",
            "departmentsAllowedToForward": "",
            "offlineMessageChannelName": "",
            "visitorInactivityTimeoutInSeconds": "",
            "parentId": "sriw2wmP2Zz2pPrre"
        },
        {
            "_id": "fqjhjfuygXBRsPBJf",
            "enabled": true,
            "name": "Marketing Support",
            "description": "Issues about merchandising actions",
            "numAgents": 3,
            "showOnRegistration": false,
            "showOnOfflineForm": false,
            "email": "",
            "_updatedAt": "2021-06-15T21:12:35.469Z",
            "maxNumberSimultaneousChat": "",
            "requestTagBeforeClosingChat": false,
            "type": "d",
            "waitingQueueMessage": "",
            "chatClosingTags": [],
            "abandonedRoomsCloseCustomMessage": "",
            "departmentsAllowedToForward": "",
            "offlineMessageChannelName": "",
            "visitorInactivityTimeoutInSeconds": "",
        }
    ],
    "count": 2,
    "offset": 0,
    "total": 2,
    "success": true
}

Last updated

Rocket.Chat versions receive support for six months after release.