Update Department
    • Dark
      Light
    • PDF

    Update Department

    • Dark
      Light
    • PDF

    Article summary

    Put
    /api/v1/livechat/department/{_id}

    Update the details of a specific department. Permissions required:

    • manage-livechat-departments
    • To add agents: add-livechat-department-agents

    Changelog

    VersionDescription
    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
    Path parameters
    _id
    stringRequired

    The department ID.

    Body parameters
    Example 1
    {
      "department": {
        "enabled": true,
        "name": "new from api - live",
        "showOnRegistration": true,
        "email": "[email protected]",
        "showOnOfflineForm": false
      },
      "agents": [
        {
          "agentId": "SQafHvoFPuB57NmBD",
          "username": "john.doe"
        }
      ]
    }
    Expand All
    object
    department
    objectRequired

    The object which takes the department details.

    enabled
    boolean Required

    Whether you want to enable the department. The value can be boolean true or false.

    showOnRegistration
    boolean Required

    You can let visitors choose the department they want to talk to. The option will appear to your customer in the Live Chat widget. The value can be boolean true or false.

    name
    string Required

    The name of the department you are creating.

    email
    string Required

    The email ID associated with the department.

    showOnOfflineForm
    boolean Required

    If you want your department to be displayed during off-business hours. The value can be boolean true or false.

    description
    string

    A description of your department.

    agents
    Array of object
    object
    agentId
    string

    The agent ID that you want to assign to the department.

    count
    string
    order
    string
    Responses
    200

    OK

    Success Example
    {
      "department": {
        "_id": "iTfLCX3qqwKgf5uqg",
        "enabled": true,
        "name": "new from api - live",
        "description": "update api",
        "numAgents": 1,
        "showOnRegistration": true,
        "_updatedAt": "2016-12-13T17:30:02.643Z"
      },
      "agents": [
        {
          "_id": "DDjZbhTF74n3NBuWK",
          "agentId": "SQafHvoFPuB57NmBD",
          "departmentId": "iTfLCX3qqwKgf5uqg",
          "username": "john.doe",
          "count": 0,
          "order": 0,
          "_updatedAt": "2016-12-13T17:30:02.656Z"
        }
      ],
      "success": true
    }
    Expand All
    object
    department
    object
    _id
    string
    enabled
    boolean
    name
    string
    description
    string
    numAgents
    integer
    showOnRegistration
    boolean
    _updatedAt
    string
    agents
    Array of object
    object
    _id
    string
    agentId
    string
    departmentId
    string
    username
    string
    count
    integer
    order
    integer
    _updatedAt
    string
    success
    boolean
    400

    Bad Request

    Example 1
    {
      "success": false,
      "error": "must have required property 'department' [invalid-params]",
      "errorType": "invalid-params"
    }
    Example 2
    {
      "success": false,
      "error": "must have required property 'name' [invalid-params]",
      "errorType": "invalid-params"
    }
    object
    success
    boolean
    error
    string
    errorType
    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.