For the complete documentation index, see llms.txt. This page is also available as Markdown.

Put WhatsApp inside your CRM or product

Show and answer WhatsApp conversations where your users already work.

Your users see WhatsApp conversations next to the customer record they already use, and reply from there. The Inbox stores the conversations and handles WhatsApp; your product only reads, displays and sends.

lightbulb-on

You do not need to store messages on your side. The Inbox keeps the full history of every conversation, and your product fetches it whenever it needs to show it.

What you end up with

  • Every new WhatsApp contact gets a record in your CRM automatically

  • Existing deals and clients update when the customer writes, and the ones that need attention are flagged

  • Opening a record shows its WhatsApp conversation, straight from the Inbox

  • Your users reply from your product, with templates when the window is closed

1

Give your product its own user

In the Inbox admin panel, create a user for your product in the App integration group, request its token and store it — see Authentication. Every call below sends that token, and every message your product sends shows that user as the sender.

2

Get told about new messages

Register a webhook for incoming messages:

curl -X POST $INBOX/api/v1/webhooks/waba/ \
  -H "Authorization: Token $SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-product.example.com/whatsapp", "on_incoming_message": true}'

The webhook is not there to copy messages into your product. It is a signal that a customer just wrote, so your CRM can react: create a record for someone new, or update the record you already have.

Reference: Create webhook

3

React to each message

When a message arrives, find out who sent it:

  1. Look up the BSUID (contacts[].user_id) in your records

  2. If there is no match and the payload has a phone number, look that up

New contact? Create a record — a new lead, deal or client, depending on your CRM. Store the BSUID and the wa_id on it; the wa_id is what you use to fetch the conversation later. Some customers never share a phone number with you, so do not make it a required field. See Contacts.

Existing contact? Update the record so your team sees what is happening without opening WhatsApp. For example:

  • Set the last contact date, so stale deals and quiet clients are easy to spot

  • Move a deal forward, such as from contacted to replied

  • Flag the record as needing attention — the customer is waiting for an answer, or the message mentions something urgent like a complaint or a cancellation

4

Show the conversation

When a user opens a record, pull the conversation from the Inbox using the stored wa_id:

curl -H "Authorization: Token $SERVICE_TOKEN" "$INBOX/api/v1/messages/?wa_id=$WA_ID&limit=20"

Load older messages with before_time as the user scrolls — see Reading conversations. To keep an open conversation up to date, fetch it again, or use a websocket connection to get new messages as they happen (advanced).

Reference: List messages

5

Reply from your product

Before showing a free-form reply box, check contact.messaging_window_expires_at on the chat. If the window is open, send the user's text. If it is closed, offer your approved templates instead. See Sending messages.

When your user replies, clear the "needs attention" flag you set in the previous step.

Reference: Create message

Keep the hosted Inbox as a fallback

Your team can still open the hosted Inbox at any time and see the same conversations, including what your product sent. It is useful for people who do not work in your product, and as a backup if your integration is down. Learn more about Hosted Inbox

Last updated

Was this helpful?