Links

Update Agents of Department

Update the agents of a specific department.
HTTP Method
URL
Requires Auth
POST
api/v1/livechat/department/:_id/agents
yes
Permissions required:
  • manage-livechat-departments
  • add-livechat-department-agents

Path Variables

Key
Example Value
Description
_id*
CAJioQNAvLnYWTy8i
The department ID.

Body Parameters

Key
Example Value
Description
upsert*
{"upsert": [ {} ] }
The object that contains the agent details.
agentId*
6523d369024dde0
The agent ID.
username*
username22
The user name of the agent.
remove*
[]
The object containing the details of the agent that you want to remove.
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.

Example Call

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": []
}'

Example Response

{
"success": true
}
Last modified 6d ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.