Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
50 lines (37 loc) · 2.74 KB

File metadata and controls

50 lines (37 loc) · 2.74 KB

Update Agents of Department

Update the agents of a specific department.

HTTP MethodURLRequires Auth
POSTapi/v1/livechat/department/:_id/agentsyes

{% hint style="info" %} Permissions required:

  • manage-livechat-departments
  • add-livechat-department-agents {% endhint %}

Path Variables

KeyExample ValueDescription
_id*CAJioQNAvLnYWTy8iThe department ID.

Body Parameters

KeyExample ValueDescription
upsert*{"upsert": [ {} ] }The object that contains the agent details.
agentId*6523d369024dde0The agent ID.
username*username22The user name of the agent.
count11The number of chats served by the agent. Enter a value if you want to reset the stored value.
Note: This field is used by the routing algorithm to determine the agents that have served the least number of chats and assign new chats to them.
order1The order in which agents are assigned to the chats.
remove*[]The object containing the details of the agent that you want to remove.

{% hint style="info" %} The agents in upsert will be assigned to the department. In case the agents are already there, their information will be updated. The agents in the remove key will be unassigned from the department. {% endhint %}

Example Call

{% code overflow="wrap" %}

curl --location 'http://localhost:3000/api/v1/livechat/department/649230d479f5c6e276cf4a12/agents' \
--header 'X-Auth-Token: oKUJdR1jFvJ7kNEIYBq' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC' \
--header 'Content-Type: application/json' \
--data '{
    "upsert": [{
        "agentId": "6529401b024dde05d3f1cd85",
        "username": "kim"
    }],
    "remove": []
}'

{% endcode %}

Example Response

{
    "success": true
}