Connect
token query parameter (a WebSocket handshake can’t set headers), using
the same API key as the REST API.
Frames
The first frame acknowledges the connection:{ event, data }, where data carries the same fields as the
corresponding webhook payload:
message.received, message.delivered, message.bounced,
message.complained, message.rejected.
Realtime frames nest the payload under
data; webhooks deliver the same fields flat alongside
event. Read frame.data.* over the socket.Reconnecting
If the socket drops, reconnect and resume. The stream is live-only (it doesn’t replay missed events), so for guaranteed delivery pair it with a webhook or reconcile withGET /messages on reconnect.
Realtime vs webhooks
Many apps use both — a webhook for durable processing and the WebSocket for a live view.

