After you start a session, it sits in aDocumentation Index
Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt
Use this file to discover all available pages before exploring further.
CONNECTING state waiting to authenticate with a WhatsApp account. Pairing is how you complete that authentication. Titan offers two methods: scanning a QR code from the WhatsApp app, or entering an 8-digit code via the phone number pairing flow. Both result in the same CONNECTED state; choose based on what works for your use case.
- QR Code
- Phone Number Code
QR code pairing
The QR code flow is the standard WhatsApp multi-device linking experience. Your backend fetches the QR code from Titan and renders it for the user to scan.How it works
Fetch the QR code
Call Response:Add
GET /api/{session}/pair/qr to retrieve the current QR code data. The response includes a qr string — encode it into a QR image and display it to the user.?format=image to receive a PNG directly instead of JSON:Poll for QR refreshes
WhatsApp QR codes rotate every ~20 seconds. Poll the endpoint every few seconds and re-render the image whenever the
qr value changes. Continue polling until the session status becomes CONNECTED or DISCONNECTED.User scans the QR code
On the phone that owns the WhatsApp number, open WhatsApp → Settings → Linked Devices → Link a Device, then scan the QR code.
Connection confirmed
On success, the session moves to
CONNECTED and Titan fires the session.connected webhook with the linked phone number, push name, business name, platform, and LID.If the QR code expires before the user scans it, the session moves to DISCONNECTED with reason QR_TIMEOUT. Restart the session and try again.Webhook events during pairing
Subscribe to these events on your webhook to track the pairing flow in real time:| Event | When it fires |
|---|---|
session.qr | A new QR code is available (fires each time the code rotates) |
session.status | The session status changes (e.g. CONNECTING → CONNECTED) |
session.connected | Pairing succeeded; includes phone number, push name, and LID |
session.logged_out | The WhatsApp account unlinked the device |
session.connected payload:
After pairing
Once the session isCONNECTED, you can start sending and receiving messages immediately. Titan maintains the connection and reconnects automatically after brief interruptions. If the user logs out (session.logged_out), you must re-pair the session.