Skip to main content

Endpoint

GET /backend/conversations/stream
This endpoint uses Server-Sent Events (SSE) for real-time communication.

Connection

Event Types

new_message

New message received or sent.

typing

Lead is typing.

status_change

Conversation status changed.

Best Practices

Reconnection

Implement automatic reconnection logic in case of disconnection.

Heartbeat

The server sends heartbeat events every 30 seconds to keep the connection alive.

Authentication

The token is validated on initial connection. Connections with invalid tokens are rejected.

Fallback

Have a fallback with periodic polling in case SSE is not supported.

Complete Example