Sending messages from a human agent to the visitor with the Widget Escalation API
When an escalation occurs in a conversation, your application will receive a widgetEscalate event via webhook, as described in Sending messages from the visitor to the bot.
If you are using the Ultimate Chat Widget, agent escalations are handled through the Send Escalation Events to a Widget endpoint. This endpoint allows you to send updates or messages directly from a human agent to the visitor during an escalated session.
Once escalation is triggered, your application is responsible for managing the connection between the visitor and a human agent. Using this endpoint, you can send real-time updates and messages to the visitor. The following event types are supported:
- escalationQueueUpdate: Notifies the visitor of their position in the queue or estimated wait time while waiting for an available agent.
- escalationSuccess: Indicates the visitor is now connected with a human agent. You can provide details such as the agent’s name and avatar. After this event, visitors and agents can exchange messages.
- message: Sends a chat message from the agent to the visitor via the widget. This event can only be used after a successful escalation (
escalationSuccess). - escalationFailed: Informs the visitor that the escalation attempt was unsuccessful and no agent could be connected.
- agentDisconnect: Notifies the visitor that the agent has ended the escalated conversation.
Each event type requires a specific payload structure. For details on the available event types and their payloads, see Handling widget escalations.