Get List of Departments

Get a list of the departments.

HTTP MethodURLRequires Auth

GET

/api/v1/livechat/department

Query Parameters

This endpoint supports the Pagination parameters. Additional optional query parameters are as follows:

KeyExample ValueDescription

text

fin

Filter the result with any text.

enabled

true

Filter the result to only show enabled departments. The value can be boolean true or false.

showArchived

true

You can include the archived departments in the result. The value can be boolean true or false.

onlyMyDepartments

true

This parameter is for users with managers or admin roles. It only displays the departments that you are an agent of.

excludeDepartmentId

64181a0728384134ed600dcc

The department ID that you want to exclude from the result.

Example Call

curl --location 'http://localhost:3000/api/v1/livechat/department' \
--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQ' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC' \
--data ''

Example Response

{
    "departments": [
        {
            "_id": "64181a0728384134ed600dcc",
            "enabled": true,
            "name": "Support",
            "description": "",
            "showOnRegistration": false,
            "showOnOfflineForm": false,
            "requestTagBeforeClosingChat": false,
            "email": "kim.jane@rocketchat.com",
            "chatClosingTags": [],
            "offlineMessageChannelName": "Livestream",
            "abandonedRoomsCloseCustomMessage": "",
            "waitingQueueMessage": "",
            "departmentsAllowedToForward": [],
            "fallbackForwardDepartment": "",
            "_updatedAt": "2023-10-13T13:03:58.406Z",
            "numAgents": 4,
            "type": "d"
        },
        {
            "_id": "649230d479f5c6e276cf4a12",
            "enabled": false,
            "name": "Finance",
            "description": "",
            "showOnRegistration": false,
            "showOnOfflineForm": false,
            "requestTagBeforeClosingChat": false,
            "email": "test@gmail.com",
            "chatClosingTags": [],
            "offlineMessageChannelName": "",
            "abandonedRoomsCloseCustomMessage": "",
            "waitingQueueMessage": "",
            "departmentsAllowedToForward": [],
            "fallbackForwardDepartment": "",
            "type": "d",
            "_updatedAt": "2023-10-13T13:03:58.426Z",
            "numAgents": 3,
            "businessHourId": "650dc9cfa2f73c7460e18bea"
        }
    ],
    "count": 2,
    "offset": 0,
    "total": 2,
    "success": true
}

Change Log

VersionDescription

2.2.0

Added support to pagination

0.42.0

Added

Last updated

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