Skip to main content

WebSocket Events

The Zeplo WebSocket API uses Socket.IO events for bi-directional communication. This page documents every event your application can emit and every event it should listen for.

Client-to-Server Events

These events are sent from your application to the Zeplo server.

join_conversation

leave_conversation

agent_join_conversation

agent_typing

agent_stopped_typing

agent_send_message

message_read

close_conversation

transfer_conversation

You must specify either toAgentId or toQueueId when transferring a conversation. If both are provided, toAgentId takes priority.

Server-to-Client Events

These events are sent from the Zeplo server to your application.

new_message

message_status_update

conversation_updated

agent_assigned

user_typing

user_stopped_typing

Rooms

Events are scoped to rooms. You must join the appropriate room before you will receive events.

Joining Rooms

Rooms are joined automatically when you emit join_conversation. For site-level and user-level rooms, connect with the appropriate authentication context:
You can be subscribed to a maximum of 500 conversation rooms per WebSocket connection. Use site-level rooms if you need broader coverage.

Best Practices

Socket.IO reconnects automatically, but room subscriptions are lost on reconnection. Re-subscribe to all active rooms after a connect event:
Socket.IO manages heartbearts automatically. The default ping interval is 25 seconds with a 20-second timeout. If you need to customize these values:
Do not send custom ping events — Socket.IO handles this for you.
Always listen for error events to catch permission issues and validation failures:
Leave rooms when they are no longer needed to reduce unnecessary event traffic. For example, when an agent closes a conversation tab in your UI: