Get Departments by Unit ID

Prev Next
Get
/api/v1/livechat/units/{unitId}/departments
Premium tag

Permission required: manage-livechat-units

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Path parameters
unitId
stringRequired

The unit ID.

Query parameters
offset
integer

Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.

Example50
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example25
Responses
200
Success Example
{
  "departments": [
    {
      "_id": "MfvRXBwEWY6tTwqFh",
      "enabled": true,
      "name": "C",
      "description": "test dept",
      "showOnRegistration": true,
      "showOnOfflineForm": true,
      "requestTagBeforeClosingChat": true,
      "email": "[email protected]",
      "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
}
Expand All
object
departments
Array of object
object
_id
string
enabled
boolean
name
string
description
string
showOnRegistration
boolean
showOnOfflineForm
boolean
requestTagBeforeClosingChat
boolean
email
string
chatClosingTags
Array of string
string
offlineMessageChannelName
string
maxNumberSimultaneousChat
string
visitorInactivityTimeoutInSeconds
string
abandonedRoomsCloseCustomMessage
string
waitingQueueMessage
string
departmentsAllowedToForward
string
_updatedAt
string
numAgents
integer
ancestors
Array of string
string
parentId
string
fallbackForwardDepartment
string
count
integer
offset
integer
total
integer
success
boolean
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
  "success": false,
  "error": "unauthorized"
}
object
success
boolean
error
string
Tags