Departments help filter chat requests to specific groups of agents. How do I set or change the department of a chat?
Before a chat has started
Before a chat starts the department can be set using the trigger condition Set visitor department as described in this article: Automatically route chats to departments. You can also use the API to set the chat department. Read more about that in our developer documentation: Chat API: Departments. Finally, if you have the pre-chat form enabled, the visitor can choose a department from within the form when they request a chat.
After a chat has started
After a chat has started the department can be changed manually by an agent. At this point it is too late for a trigger or the API to make a change.