Skip to main content
For low-latency agents, open a WebSocket and SentFromAI pushes your events the moment they happen — no webhook endpoint required.

Connect

Authentication is the 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:
After that, every event is pushed as { event, data }, where data carries the same fields as the corresponding webhook payload:
The event names match webhooks: 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 with GET /messages on reconnect.

Realtime vs webhooks

Many apps use both — a webhook for durable processing and the WebSocket for a live view.