Create Unit
    • Dark
      Light
    • PDF

    Create Unit

    • Dark
      Light
    • PDF

    Article summary

    Post
    /api/v1/livechat/units
    Premium tag

    Create a unit to group departments. Permission required: manage-livechat-units

    Changelog

    VersionDescription
    4.2.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
    Body parameters
    Example 1
    {
      "unitData": {
        "name": "unitxx2",
        "visibility": "public"
      },
      "unitMonitors": [
        {
          "monitorId": "GT67Tv6x5p5y5xZWN",
          "username": "testerio"
        }
      ],
      "unitDepartments": [
        {
          "departmentId": "CgM4vfNNtj8t4QEMd"
        }
      ]
    }
    Expand All
    object
    unitData
    objectRequired

    The object containing the unit information.

    name
    string Required

    The name of the unit that you are creating.

    Exampleunitxx2
    visibility
    string Required

    The visibility of the unit. For example, public or private.

    unitMonitors
    Array of object Required

    The object containing the unit monitors information.

    object
    monitorId
    string Required

    The monitor ID that you want to add to the unit.

    ExampleGT67Tv6x5p5y5xZWN
    username
    string Required

    The user name of the monitor.

    Exampletesterio
    unitDepartments
    Array of object Required

    The object containing the department information.

    object
    departmentId
    string Required

    The department ID that you want to add to the unit.

    ExampleCgM4vfNNtj8t4QEMd
    Responses
    200
    Success Example
    {
      "name": "unitxx2",
      "visibility": "public",
      "type": "u",
      "numMonitors": 1,
      "numDepartments": 1,
      "_updatedAt": "2021-12-06T14:30:27.744Z",
      "_id": "o5zNtKy7BcTMgyXtm",
      "success": true
    }
    object
    name
    string
    visibility
    string
    type
    string
    numMonitors
    integer
    numDepartments
    integer
    _updatedAt
    string
    _id
    string
    success
    boolean
    400

    Bad Request

    Example 1
    {
      "success": false,
      "error": "Match error: Expected object, got undefined"
    }
    object
    success
    boolean
    error
    string
    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.