WebSocket Events
Stream message and session status into dashboards and live products.
WAStack's WebSocket API provides a persistent, bidirectional connection for real-time event streaming. Unlike webhooks which deliver events via HTTP POST, WebSockets maintain an open connection for instant, low-latency event delivery.
Connect to the WebSocket endpoint using your API key, then subscribe to specific event channels: messages, sessions, media, or automation. Events are delivered as JSON payloads with consistent schemas matching the webhook format.
WebSockets are ideal for live dashboards, real-time monitoring tools, chat interfaces, and any application that needs sub-second event delivery. The connection includes automatic heartbeat pings to maintain connectivity and automatic reconnection on drop.
You can combine WebSockets with webhooks for redundancy: use WebSockets for real-time UI updates and webhooks as the durable event log.
Key Benefits
- Sub-second event delivery
- Persistent bidirectional connection
- Automatic heartbeat and reconnection
- Filterable event channel subscriptions
- Works alongside webhooks for redundancy
Use Cases
- Building live message monitoring dashboards
- Creating real-time customer support interfaces
- Developing interactive WhatsApp chat widgets
- Monitoring session health in real-time
Frequently asked questions
Common questions about websocket events.
Discover all WAStack features
From QR login to campaign messaging, explore the complete set of tools for building WhatsApp infrastructure.