onCurrentCapacityChanged()

Registers a function to call when an agent’s capacity for accepting chats changes—for example, if an agent accepts a new chat, ends a currently engaged chat, or otherwise changes the number of chats to which they are assigned, or if a chat request is pushed to their chat queue. Available in API version 29.0 or later.

NameTypeDescription
eventHandlerfunctionJavaScript method called when the agent’s capacity for accepting chats has changed.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following properties:

NameTypeDescription
countintegerThe number of chats in which the agent is currently engaged plus the number of chat requests currently assigned to the agent.
successBooleantrue if firing event was successful; false if firing event wasn’t successful.