Concepts
Connections
How WhatsApp connections work in WAHooks
A connection is a linked WhatsApp account. When you create a connection, WAHooks provisions a cloud-hosted WAHA session that maintains the WhatsApp Web connection on your behalf.
Architecture
Your App → WAHooks API → WAHA Worker Pod → WhatsAppEach connection runs in its own isolated container (WAHA pod) in the WAHooks Kubernetes cluster. The pod handles:
- WhatsApp Web protocol (NOWEB engine)
- Message sending and receiving
- Event forwarding to the WAHooks API
- Session persistence (survives pod restarts)
Session lifecycle
- Create (
pending) — a WAHA pod is provisioned and a session is created - QR Scan (
scan_qr) — you scan a QR code with WhatsApp to link the account - Connected (
connected) — the session is active, messages flow in and out - Failed (
failed) — the session lost connection (auto-recovered within 3 minutes) - Stopped (
stopped) — you deleted the connection
Health monitoring
WAHooks polls WAHA sessions every 3 minutes:
- FAILED sessions are automatically reset and restarted
- STOPPED sessions that should be active are restarted
- Missing sessions (after pod restart) are auto-created with full config
One session per number
Each WhatsApp number can only be linked to one connection at a time. Creating a new connection for a number that's already linked elsewhere will unlink the existing session.
Chat IDs
WhatsApp uses specific ID formats:
| Type | Format | Example |
|---|---|---|
| Individual | {country}{phone}@s.whatsapp.net | 1234567890@s.whatsapp.net |
| Group | {id}@g.us | 120363419246216126@g.us |
Use the chats endpoint to discover chat IDs.