Communication
WhatsApp in your product and your AI agents, through one API
The WhatsApp Cloud API toolkit covers business accounts, phone numbers, sending messages, message templates and the business profile of a number. Through Connect your product or AI agent calls them with one endpoint, while Connect stores the credentials and logs every execution.
15 days to try it. No credit card.
POST https://connect.reportei.com/api/tools/whatsapp_send_message/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json
{
"customer_toolkit": "<connection UUID>",
"arguments": {
"phone_number_id": "<phone_number_id>",
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<recipient_number_with_country_code>",
"type": "text",
"text": {
"body": "Hello! This is an example message.",
"preview_url": false
}
}
}How it works
From a connected customer to the first WhatsApp call.
- 1
Your customer connects the account
Your system opens a Connect session for the toolkit and your customer connects their WhatsApp account. You get the connection id.
- 2
Your product calls the tool
A POST to /api/tools/{tool}/execute with the connection id and arguments. On success, Connect preserves the app's response status and body.
- 3
Connect handles the rest
It stores the credential encrypted, renews tokens for OAuth connections that support renewal and records executions in an audit trail available through the API.
Use cases
What your product does with WhatsApp.
Send notifications by template
A SaaS starts a conversation by sending a message of type template with an approved template, for example to confirm an order.
Manage templates from your app
A product creates a message template, submits it to Meta review, then edits or deletes it as the content changes.
Reply to customers with an agent
An AI agent answers with a free-form text message to someone who wrote to the number in the last 24 hours.
Tools
10 WhatsApp tools
- List business accountsGETLists the WhatsApp Business accounts the system user can reach, with id and name. That id is the waba_id of the other tools, which Meta now also calls the Messaging account id. The response has data and paging.cursors.after: pass it as after to read the next page.
- Get business accountGETReturns a WhatsApp Business account with the fields asked for, which can be account data or analytics. Without fields only id and name come back.
- List phone numbersGETLists the business phone numbers of a WhatsApp Business account with id, display_phone_number, verified_name and quality_rating. That id is the phone_number_id of the message and profile tools. The response has data and paging.cursors.after: pass it as after to read the next page.
- Send messagePOSTSends a message from a business phone number and returns its id in messages[0].id. Free-form types (text, image, video, document, audio) only reach someone who wrote to the number in the last 24 hours; to start a conversation, send type template with an approved template from List message templates. Meta bills messages to the account according to its WhatsApp pricing.
- List message templatesGETLists the message templates of a WhatsApp Business account with id, name, language, status, category and components. The response has data and paging.cursors.after: pass it as after to read the next page.
- Create message templatePOSTCreates a message template and submits it to Meta review, returning id, status and category. It can be sent once the status is APPROVED, which can take up to 24 hours. Variables are {{1}}, {{2}} in the POSITIONAL format or {{first_name}} in the NAMED format, and each one needs an example. An image, video or document header needs a file handle from an upload, which this connection does not do.
- Update message templatePOSTEdits a template and sends it to review again. Only templates in APPROVED, REJECTED or PAUSED status can be edited, and only their category and components; components replaces all the parts. An approved template takes up to 10 edits in 30 days and 1 in 24 hours, and its category cannot change.
- Delete message templateDELETEDeletes a template by name, in all its languages, or only the language version whose id is hsm_id. The name of a deleted approved template cannot be used again for 30 days.
- Get business profileGETReturns the business profile people see on a phone number: about, address, description, email, websites, vertical and profile_picture_url.
- Update business profilePOSTUpdates the business profile of a phone number. Fields left out keep their value, and websites replaces the websites of the profile.
API key
Your customer pastes the app's key on a Connect screen, or your system sends the key with POST /api/customer-toolkits, with no screen.
Questions about the WhatsApp toolkit
Do I need to build against the WhatsApp API?
No. Connect ships 10 WhatsApp tools, described and ready. Your customer connects the account and your system calls every tool through the same endpoint, with the same request format.
How does my customer connect their WhatsApp account?
With the mode the toolkit accepts: API key. Connect stores the credential encrypted and never returns it to your system.
Does it work with AI agents?
Yes. Each tool's input is described in JSON Schema, which your agent uses directly as a tool definition. The agent picks the tool and the arguments, and your system makes the call to Connect.
Does my customer need a Reportei account?
No. Your customer connects the account on a Connect screen, or your system sends the credential through the API, and they keep using only your product.
See Connect applied to your product.
Try it for 15 days with no card, or walk our team through your use case.
