GuidesMessaging
Overview
Messaging — Overview
Messaging is Corteksa's unified inbox. One API sends and receives messages across five providers — WhatsApp (WAHA), WhatsApp Cloud, Facebook Messenger, Instagram Direct, and TikTok — and links every conversation to a CRM record.
When should I use Messaging?
- You want to send and receive WhatsApp / Messenger / Instagram / TikTok messages from inside Corteksa.
- You want conversations auto-linked to contacts so agents see the CRM record next to the chat.
- You want real-time updates (new message, delivery/read receipts, typing) pushed to your UI.
- You need role-based access so an agent only sees the chats they're allowed to.
If you only need to notify a customer once (no conversation), a provider template or the Recipes may be enough.
How Messaging works
Three objects, addressed by slug (never numeric id):
| Concept | What it is |
|---|---|
| Session | A connected provider account (a WhatsApp number, a Facebook page, …). Created via QR (WAHA) or OAuth (Meta/TikTok). |
| Chat | One conversation inside a session, optionally linked to a CRM record. |
| Message | A single text or media message inside a chat. |
A message flows: your UI → REST API → a Bull queue → the provider adapter → the provider. Inbound messages flow back through a provider webhook → handler → database → Redis → WebSocket → your UI. See Architecture.
Provider capabilities
| Capability | WAHA | WhatsApp Cloud | TikTok | ||
|---|---|---|---|---|---|
| Text / media | ✓ | ✓ | ✓ | ✓ | ✓ |
| Reply to message | ✓ | ✓ | ✓ | ✓ | ✓ |
| Read receipts / typing | ✓ | ✓ | ✓ | ✓ | ✓ |
| Edit / delete message | ✓ | ✗ | ✗ | ✗ | ✗ |
| Group chats | ✓ | ✗ | ✗ | ✗ | ✗ |
| Auth | QR | Cloud API | OAuth | OAuth | OAuth |
| Templates | ✗ | ✓ | Planned | ✗ | ✗ |
Next
- Build the UI → Frontend Integration
- Wire the backend → Backend Integration
- The endpoints → REST API