Get List of Departments
    • Dark
      Light
    • PDF

    Get List of Departments

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/livechat/department

    Get a list of the departments. At least one of the following permissions is required:

    • view-livechat-departments
    • view-l-room

    Changelog

    VersionDescription
    2.2.0Added support to pagination
    0.42.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authToken of the authenticated user.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The userId of the authenticated user.

    ExamplerbAXPnMktTFbNpwtJ
    Query parameters
    text
    string

    Filter the result with any text.

    Examplefin
    enabled
    boolean

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

    ExampleTrue
    showArchived
    boolean

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

    ExampleTrue
    onlyMyDepartments
    boolean

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

    ExampleTrue
    excludeDepartmentId
    string

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

    Example64181a0728384134ed600dcc
    offset
    integer

    Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.

    Example50
    count
    integer

    The number of items to return.

    Example25
    sort
    (object)

    List of fields to order by, and in which direction. JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, sort = {"value": -1, "_id": 1}

    Responses
    200

    OK

    Success Example
    {
      "departments": [
        {
          "_id": "64181a0728384134ed600dcc",
          "enabled": true,
          "name": "Support",
          "description": "",
          "showOnRegistration": false,
          "showOnOfflineForm": false,
          "requestTagBeforeClosingChat": false,
          "email": "[email protected]",
          "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": "[email protected]",
          "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
    }
    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 object
    object
    offlineMessageChannelName
    string
    abandonedRoomsCloseCustomMessage
    string
    waitingQueueMessage
    string
    departmentsAllowedToForward
    Array of object
    object
    fallbackForwardDepartment
    string
    _updatedAt
    string
    numAgents
    integer
    type
    string
    businessHourId
    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

    Example 1
    {
      "success": false,
      "error": "User does not have the permissions required for this action [error-unauthorized]"
    }
    Example 2
    {
      "success": false,
      "error": "unauthorized"
    }
    object
    success
    boolean
    error
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.