Get Departments by Unit Id

Gives departments included in a specific unit ID.

HTTP MethodURLRequires Auth

GET

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

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.

Example Call

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

Example Response

{
    "departments": [
        {
            "_id": "MfvRXBwEWY6tTwqFh",
            "enabled": true,
            "name": "C",
            "description": "test dept",
            "showOnRegistration": true,
            "showOnOfflineForm": true,
            "requestTagBeforeClosingChat": true,
            "email": "C@test.com",
            "chatClosingTags": [
                "please add a tag"
            ],
            "offlineMessageChannelName": "",
            "maxNumberSimultaneousChat": "2",
            "visitorInactivityTimeoutInSeconds": "0",
            "abandonedRoomsCloseCustomMessage": "closed",
            "waitingQueueMessage": "please wait!",
            "departmentsAllowedToForward": "",
            "_updatedAt": "2022-12-14T14:44:51.923Z",
            "numAgents": 5,
            "ancestors": [
                "TGjc7wN84KxQup9cF"
            ],
            "parentId": "TGjc7wN84KxQup9cF",
            "fallbackForwardDepartment": "KgCzEB2gWngKp9JF3"
        }
    ],
    "count": 1,
    "offset": 0,
    "total": 1,
    "success": true
}

Last updated

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