How to Connect an AI Chatbot to WhatsApp via the Graph API

TL;DR
Matram’s WhatsApp agent is rolling out and is not enabled for every workspace yet.
The same Matram agent and connected content can serve both the website and WhatsApp without separate training.
The connection requires a WhatsApp Business number, Meta Graph API access, a verified webhook, a verify token, and an app secret.
Inbound WhatsApp messages reach Matram through the webhook; Matram retrieves from approved content and replies in the same thread.
Test source accuracy, signature validation, permissions, reply delivery, conversation history, opt-in rules, and human handoff before launch.
Introduction
Connecting WhatsApp involves more than adding a phone number. Meta must identify the business number, callback, and authorised application. Matram must receive the message, retrieve relevant information from the correct content, and return it to the same conversation.
That is the real scope of a connect AI chatbot to WhatsApp API project. Matram supplies the trained answering and handoff layer. Meta’s WhatsApp Business Platform supplies the business number, Graph API, message delivery rules, and webhook events.
Matram still labels its WhatsApp agent “coming soon,” with access rolling out across workspaces. Prepare the agent, Meta account, number, content, and tests now, but connect only after WhatsApp appears in the workspace.
What the Matram WhatsApp connection actually does
Matram brings the same trained agent used on your website into WhatsApp. A visitor sends a message to the connected business number. Meta sends the inbound event to a verified webhook. Matram retrieves relevant information from your connected website pages, files, or help content and returns a grounded reply in the WhatsApp thread.
The WhatsApp AI chatbot does not require a second knowledge base. The same connected content supports the website and WhatsApp, while both channels feed Matram’s Inbox and Chat History.
The responsibilities remain separate:
| Layer | Responsibility |
|---|---|
| Meta | Operates the WhatsApp Business Platform, Graph API, number registration, message delivery, webhook events, templates, and platform rules |
| Matram | Uses the inbound message, retrieves from connected content, generates the reply, records the conversation, and supports human handoff |
| Your team | Owns the number, permissions, approved content, opt-in, escalation rules, testing, retention, and human response |
This boundary matters. A successful webhook does not prove that the Matram answer is correct, and a correct answer does not prove that Meta delivered it.
For the wider difference between answering and taking actions through connected systems, read Matram’s AI agent versus chatbot guide.
Before you connect Matram to WhatsApp
Prepare both sides before opening the connection screen. In Matram, you need:
- A trained agent with current website pages, files, or help content
- Tested citations and refusal behaviour
- A clear human-handoff rule
- An owner for WhatsApp conversations
- WhatsApp access enabled in the workspace
In Meta, prepare:
- A business portfolio with the required administrative access
- A WhatsApp Business Account
- A business phone number that can be registered for the platform
- The application and Graph API access required by the current setup
- Permission to manage the app, number, and webhook
Keep credentials out of email, shared documents, source code, and prompts. Before you connect AI chatbot to WhatsApp API, confirm that the channel is enabled for the exact Matram workspace. A preview page is not account access.
Step 1: Train and test the Matram agent on the web
Start with the answer layer because the WhatsApp AI chatbot uses the same Matram agent and content. Connect the pages customers rely on, remove stale versions, and resolve contradictory policies.
Test real questions, including vague messages, spelling mistakes, mixed-language queries, complaints, unsupported requests, and cases requiring private data. Check the answer and citation, not only fluency.
The channel cannot repair missing documentation. Matram’s chatbot best-practices guide explains why grounding, refusal, escalation, and transcript review should be tested together.
Do not proceed with the connect AI chatbot to WhatsApp API setup until the same agent performs reliably in the web channel.
Step 2: Confirm the WhatsApp channel is available
Open the Matram workspace and check the available channels or integrations. If WhatsApp is not present, the rollout has not reached that workspace. Train the agent and prepare the Meta assets, but do not invent a manual connection path or assume that another workspace’s screen applies.
When the channel is available, follow the current Matram connection screen. The product page states that Matram will guide the setup and that the connection uses a WhatsApp Business number, Meta’s Graph API, a webhook verify token, and an app secret.
This availability check prevents the most common planning mistake: treating a previewed WhatsApp AI chatbot as a generally available switch.
Step 3: Prepare the Meta business number and API access
Use business-owned Meta assets and approved administrator accounts. Confirm who controls the business portfolio, WhatsApp Business Account, application, and phone number. Do not build the setup under a contractor’s personal account.
Use temporary test credentials only to prove the message path. For production, follow the current Meta WhatsApp Cloud API setup and Matram flow for the permanent number, access token, and permissions.
Record ownership, the phone-number identifier, credential owner, and recovery process without recording token values.
The connect AI chatbot to WhatsApp API project is not ready if only one person can access the Meta assets or explain how the number is connected.
Step 4: Configure and verify the webhook
The webhook carries inbound WhatsApp events from Meta to Matram. Use the callback URL and verification details shown in the Matram workspace. Follow Meta’s current WhatsApp webhook documentation rather than copying values from another tutorial.
During setup, Meta sends a verification request to the callback; a matching verify token completes the handshake. The app secret validates later signed events. They are different controls.
Subscribe to the message events required by the current Meta setup. Keep the callback on HTTPS, restrict secrets, and validate signed events before processing them.
This is the security-critical stage of the connect AI chatbot to WhatsApp API workflow. A public endpoint that accepts unverified payloads can feed false events into the support process.
Step 5: Connect the channel in Matram
Return to the WhatsApp setup in Matram and complete only the fields shown for your workspace. Depending on the rollout version, Matram may guide the Meta authorisation or request specific connection values. Follow the live interface because credential labels and onboarding steps can change.
Select the trained Matram agent that should answer on WhatsApp. Confirm the business number and channel before saving. Do not connect a test agent to a production number or a production knowledge base to a disposable test number without documenting the choice.
The resulting WhatsApp AI chatbot should use the same grounded content as the web agent, while keeping the WhatsApp conversation in Matram’s shared Inbox and Chat History.
Step 6: Test inbound messages and replies
Send a message from a different phone number and verify the complete path:
- WhatsApp accepts the customer message.
- Meta sends the event to the verified webhook.
- Matram records the conversation in the expected inbox.
- Matram retrieves from the correct source.
- The reply reaches the same WhatsApp thread.
- The citation or source behaviour matches the channel design.
Test short and detailed messages, unsupported requests, and the languages customers use. Invalidate a test credential and confirm the failure is visible rather than silent.
The connect AI chatbot to WhatsApp API task is complete only when both successful delivery and failure handling have been observed.
Step 7: Test human handoff in the same thread
Ask for a person, send a complaint, and submit an unsupported question. Confirm that the WhatsApp AI chatbot stops answering, captures the needed details, and moves the conversation to the team.
Matram says human replies return to WhatsApp while the conversation remains in its Inbox and Chat History. Test that return path. An internal notification alone is not a completed handoff.
Set queue ownership, response expectations, after-hours wording, and the fallback when nobody is available. Matram’s guide to chatbot use cases and their actual requirements separates answers from cases needing a person or system action.
Step 8: Apply WhatsApp messaging and privacy rules
The Graph API connection does not remove Meta’s rules. Obtain permission for business-initiated communication, respect opt-outs, and use approved templates whenever Meta rules require them. Check Meta’s live WhatsApp Business Platform documentation instead of copying old pricing or message-window guidance.
Define retention, access, deletion, and which details may enter another system. Do not request passwords, payment-card details, health records, or other sensitive data in an ordinary automated flow.
Before launch, the connect AI chatbot to WhatsApp API checklist should include policy approval, not only technical approval.
Step 9: Launch gradually and monitor both systems
Start with a limited audience or a lower-risk support path. Review early conversations for wrong sources, unsupported confidence, missed handoffs, duplicate events, delayed replies, and failed deliveries.
Monitor Matram for answer quality and escalation. Monitor Meta for number status, webhook delivery, permission issues, message failures, and policy warnings. One dashboard cannot explain every failure across both systems.
Track questions Matram could not answer and update the underlying content. The same improvement can strengthen both the website agent and the WhatsApp AI chatbot because they share the trained knowledge base.
Common setup mistakes
Do not begin the connect AI chatbot to WhatsApp API project before Matram enables the channel. Never publish temporary tokens, skip webhook validation, equate webhook delivery with reply delivery, or test only FAQs. Complaints and private account actions need a human route. Consent, templates, and Meta policy remain the business’s responsibility.
When Matram is a good fit and when to wait
Matram fits when one grounded WhatsApp AI chatbot should answer from approved content across the website and WhatsApp, keep conversations in one inbox, and hand difficult cases to a person.
Wait if the channel is unavailable, number ownership is unclear, source content is unreliable, or nobody owns handoff. Consider a custom Graph API integration for complex transactional messaging, bespoke media processing, or account-specific workflows beyond Matram’s published scope.
That limitation keeps the WhatsApp AI chatbot promise accurate. Matram supplies grounded conversations and handoff; it does not remove Meta’s platform rules or replace the systems behind private customer actions.
Frequently asked questions
Can every Matram workspace connect to WhatsApp today?
No. WhatsApp is rolling out and is not enabled for every Matram workspace. Check access before planning a launch.
Does the WhatsApp agent need separate training?
No. The WhatsApp AI chatbot uses the same Matram agent and connected content as the web channel.
What is needed to connect AI chatbot to WhatsApp API?
You need Matram WhatsApp access, a trained agent, a WhatsApp Business number, Meta Graph API access, the required application permissions, and a verified webhook using the values requested by the current Matram setup.
Where do Matram WhatsApp conversations appear?
Matram states that they appear in the same Inbox and Chat History as web conversations, with human replies relayed back into WhatsApp.
Does connecting Matram remove Meta’s template and consent rules?
No. The business remains responsible for Meta policy, customer permission, approved templates, and responsible data handling.
Prepare the agent before connecting the channel
The safest way to connect AI chatbot to WhatsApp API is to treat the channel as the last step, not the first. Train Matram on current content, test refusals and handoff on the web, secure organisational ownership of the Meta assets, and document the production test plan.
Then confirm that WhatsApp is enabled in the Matram workspace and follow the live connection flow. Review Matram’s WhatsApp agent, prepare the business number and webhook controls, and launch only after the WhatsApp AI chatbot has passed both reply and handoff tests.
See Matram in action
Watch it answer from real content, with the exact source page cited, on the live demo.
Book a demo