Skip to main content
The messaging WebSocket pushes events to a connected client as they happen: a reply arriving, a delivery receipt, a broadcast counter moving, a 10DLC campaign changing stage, a number being purchased. It is built for dashboards and consoles that are open on screen. For events your backend must never miss, use webhooks; they are redelivered until accepted.

Connect

Authentication depends on where the client runs: The connection is scoped to your account. You receive every event for the account; there is no per-topic subscription. Anything you send to the server is read and ignored, so you can send a small frame periodically as a keep-alive.
Never put your Auth Token in browser code. The ?token= form is for the console session JWT only. If you need live events in your own web app, terminate the WebSocket on your server and relay to the browser.

Frames

Every frame from the server is a JSON text message with two keys:
event is one of the six names below. data is the full object the event concerns, so you can update your UI without a follow-up request. Example frames:
message.status
numbers.updated

Node example

Install the ws package (npm install ws), then:
Node

Browser example

In the browser you pass the console session JWT in the query string. Here sessionToken is the JWT your signed-in console session holds.
Browser

Reconnect and backfill

A WebSocket drops when networks change, proxies time out or the server restarts. Plan for it:
1

Reconnect with exponential backoff

Start at about one second, double on each failed attempt, cap at 30 seconds, and add jitter so many clients do not reconnect at the same instant. Reset the counter after a successful connection.
2

Backfill after reconnecting

Events emitted while you were disconnected are not replayed on the socket. Record the time of the last frame you processed and, on reconnect, call GET /messages with startDate set to that time to pick up messages and status changes. For broadcasts and registrations, re-read the objects you have on screen with GET /broadcasts/{id}, GET /10dlc/brands/{id} and GET /10dlc/campaigns/{id}.
3

Keep the connection alive

Send a small frame every 30 seconds or so. The server reads and discards client frames, and the traffic keeps idle-connection timeouts on intermediaries from closing the socket.
4

Use webhooks for anything that must be durable

If your backend acts on an event, for example marking an order as notified when message.status reaches delivered, subscribe to it with a webhook. Webhooks are redelivered until your endpoint accepts them; the socket is a live view.

Next steps

Webhooks

Durable, signed delivery to your server.

Conversations

Build an inbox from message.received events.

Before you go live

Compliance overview

The registration events you will see stream in.

Messaging numbers

Purchases and releases behind numbers.updated.