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 emitjoin_conversation. For site-level and user-level rooms, connect with the appropriate authentication context:
Best Practices
Handling reconnections
Handling reconnections
Socket.IO reconnects automatically, but room subscriptions are lost on reconnection. Re-subscribe to all active rooms after a
connect event:Heartbeat and keepalive
Heartbeat and keepalive
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.
Error handling
Error handling
Always listen for error events to catch permission issues and validation failures:
Room management
Room management
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:
