HTTP Method | URL | Requires Auth |
---|
POST | /api/v1/livechat/units/:id | yes |
{% hint style="info" %}
Permission required: manage-livechat-units
{% endhint %}
Key | Example Value | Description |
---|
id * | 4uErt483aPJAg6Xk4 | The unit ID. |
Key | Example Value | Description |
---|
unitData * | { "unitdata": {...} } | The object containing the unit data. |
name * | unitxx2 | The name of the unit that you are creating. |
visibility * | public | The visibility of the unit. For example, public or private . |
unitMonitors * | "unitMonitors": [{...}] | The object containing the unit monitors information. |
monitorId * | GT67Tv6x5p5y5xZWN | The monitor ID that you want to add to the unit. |
username * | testerio | The user name of the monitor. |
unitDepartments * | "unitDepartments": [{...}] | The object containing the department information. |
departmentId * | CgM4vfNNtj8t4QEMd | The department ID that you want to add to the unit. |
{% code overflow="wrap" %}
curl --location --request POST 'localhost:3000/api/v1/livechat/units/4uErt483aPJAg6Xk4' \
--header 'x-Auth-token: jx-CrbeqbxPimsZr1UAhO3NsJdU8yB0MVoXkGOKQ3xL' \
--header 'x-user-id: 6vHSSqdBHdm2R4gfi' \
--header 'Content-Type: application/json' \
--data-raw '{
"unitData": {
"name": "unitxx2",
"visibility": "private"
},
"unitMonitors": [{
"monitorId": "GT67Tv6x5p5y5xZWN",
"username": "testerio"
}],
"unitDepartments": [{
"departmentId": "CgM4vfNNtj8t4QEMd"
}]
}'
{% endcode %}
{
"name": "unitxx2",
"visibility": "private",
"type": "u",
"numMonitors": 1,
"numDepartments": 1,
"_updatedAt": "2021-12-06T14:40:59.478Z",
"_id": "o5zNtKy7BcTMgyXtm",
"success": true
}
Version |
Description |
4.2.0 |
Added |