WhatsApp API for developers: sending from your system, webhooks, OTP and agent tools
The developer guide to wiring a system or ERP to WhatsApp: a keyed send API for templates and texts with their status, order and cart webhooks, the OTP API, and the webhook tools and MCP servers the agent reads your system through — and what is not open yet.
On this page 7
The short answer
Five doors work today: a keyed send API that sends an approved template or a text from your system and returns every message's status, a webhook that takes your store's orders from any system and runs the confirmation and status messages, a webhook for abandoned-cart events, the OTP API to send and verify a code, and webhook tools and MCP servers through which the AI agent calls your system to read orders and live stock. Reading subscribers and creating broadcasts or templates through the API are not open yet. All of it runs on Meta's official API.
Also asked as: «واتساب api للمبرمجين» · «webhook واتساب» · «ازاي ابعت رسالة واتساب من الكود» · «ربط واتساب api بالنظام» · «كيف أربط WhatsApp API بالموقع؟» · «whatsapp api key» · «whatsapp business api documentation» · «whatsapp business api key»
The five doors open today — and what is not
| Door | Direction | Auth | Does |
|---|---|---|---|
| The send API | Your system → platform | A key in the Authorization header | Sends an approved template or a text inside 24 hours, and returns every message's status |
| Order-intake webhook | Your system → platform | Key in the URL | Runs order confirmation and status messages for a store on any platform |
| Cart-events webhook | Your system → platform | Secret + HMAC signature, or a key | Runs abandoned-cart reminders |
| OTP API | Your system → platform | Public key in a header + optional signing with the secret | Send a verification code on WhatsApp, verify it, resend it |
| Agent tools: webhook and MCP | Platform → your system | Headers you set (encrypted at rest) | The agent reads live orders, stock and appointments from your system and answers from them |
| Subscribers, broadcasts, template creation and events to your system | — | — | Not open yet |
1. Sending a message from your system: the send API
Take the key from «Developer tools» in the ArabyBot dashboard and send it in the Authorization header. Ask for your approved templates first — each comes with a ready request body — then send the template to the number with its variables. The reference field protects you from sending twice if you repeat the request.
GET https://app.arabybot.com/api/v1/templates Authorization: Bearer abk_…
POST https://app.arabybot.com/api/v1/messages/template Authorization: Bearer abk_…
{ "to": "201012345678", "template": "order_shipped", "language": "ar",
"variables": ["Ahmed", "1042"], "reference": "order-1042-shipped" }
→ { "success": true, "id": 512, "message_id": "wamid.…", "status": "accepted", "to": "201012345678" }
GET https://app.arabybot.com/api/v1/messages/{id} → delivered · read · failed + the reason
Free text through /api/v1/messages/text is accepted only inside the 24-hour window since the customer's last message, as Meta requires. API messages show in the live chat with the rest of the conversation, and Meta's fees are on your account with no markup from us. The API is on the WhatsApp Pro, WhatsApp Premium, Complete Plan and Ultimate Plan plans.
2. Order intake from any system
For stores not on Shopify or WooCommerce: your system posts the order event to an intake URL tied to your account, and the pre-shipping confirmation and status updates run as they do for connected stores. The URL and key come from the order-confirmation settings page, and the exact field shape is in the API Reference tab inside the dashboard.
POST https://app.arabybot.com/wa_notify_webhook/api/{api_key}
Content-Type: application/json
{ "order_id": "1042", "status": "created",
"customer": { "name": "…", "phone": "+2010…" },
"items": [ { "name": "…", "qty": 1, "price": 350 } ],
"total": 350, "currency": "EGP" }
The exact field names and when each event is sent (created, confirmed, shipped, delivered, cancelled) are in the reference inside the dashboard — not copied here so they never go stale.
3. Cart events
A "cart created" and "cart abandoned" event from your store runs the recovery messages at the timing you set. Two ways: a URL with a secret and an HMAC signature for platforms we ship a plugin for, or a keyed URL for your own system. Cart recovery.
4. The OTP API
Three endpoints: send the code, verify it, resend it — with a public key and a secret for your app from the OTP page. The code arrives on an approved authentication template at Meta's rate for the recipient's country, cheaper than SMS in most of our markets. OTP on WhatsApp or SMS.
POST https://app.arabybot.com/wa_otp_api/send X-Public-Key: ab_otp_… { "phone": "9665…" }
→ { "success": true, "request_id": "3f6c…", "expires_in": 300 }
POST https://app.arabybot.com/wa_otp_api/verify X-Public-Key: ab_otp_… { "request_id": "3f6c…", "code": "482913" }
POST https://app.arabybot.com/wa_otp_api/resend X-Public-Key: ab_otp_… { "request_id": "3f6c…" }
The full contract — signing, errors, limits and PHP, Laravel, Node.js and Python examples — is in the OTP API guide, and the machine spec at openapi.json.
5. The agent reads your system: webhook tools and MCP servers
- Define the tool
From the agent → tools → add: the name ("order_status"), the description the model reads ("returns an order's status by number"), a public URL, the method GET or POST. The description decides when the agent calls it, so write it as you would explain it to a teammate.
- Return simple JSON
Clearly named fields with text values: {"status":"shipped","eta":"Thursday"}. The agent phrases the reply from them; return no HTML and no pages.
- Or connect an MCP server
From the agent → MCP servers → quick connect: the URL, the token and headers. The server's tool list is read and you choose which are allowed; tokens are stored encrypted.
- Know the limits
Public URLs only (no 10.x, no localhost), resolved once and pinned to one IP, redirects not followed, http/https only, and a per-customer call rate limit. That protects your system and ours alike.
The send API sends and tracks only. Reading subscribers, creating broadcasts, creating or editing templates, and events the platform sends to your system when a customer replies are not open yet. Broadcasts run from the campaigns page in the dashboard, templates from the templates page, and replies are handled by the AI agent or your team in the live chat.
Frequently asked questions
Is there an API to send a WhatsApp message from my system?
Yes, since October 2026: the send API sends an approved template, or a text inside the 24-hour window, from your system, returns every message's status and lists your templates with a ready example. The key comes from «Developer tools» on the WhatsApp Pro, WhatsApp Premium, Complete Plan and Ultimate Plan plans. It does not yet cover reading subscribers or creating broadcasts or templates, and the platform sends no events to your system.
How does the AI agent read live data from my system?
You define a tool for it: a name, a description, a public URL and a method (GET or POST). When the agent needs what the tool describes ("the status of order…") it calls it with the parameters, reads the JSON reply and answers the customer from it. The URL must be public (no private network), it is resolved once and pinned, redirects are not followed, and calls are rate-limited per customer.
What is MCP, and when do I use it instead of a webhook tool?
A protocol through which your server lists its tools to the model in one format. You connect the server URL and its token from the dashboard, its tools are read, and you choose which the agent may use. Pick it when you have more than a couple of tools or a system that already speaks it; a webhook tool when you have one simple endpoint.
My store is on a platform with no integration — how do I send orders?
Through the order-intake webhook: your system posts the order event (order number, customer and phone, items, amount, status) to your own URL with your key, and the confirmation and status messages run as if the store were connected. The exact request shape is in the API Reference tab inside the dashboard.
Do the calls cost anything?
The webhooks and calls themselves, nothing. What is billed is what they produce: a WhatsApp message you start on a template at Meta's rate for your country, and the AI agent's reply according to your plan. Pricing.
Read next
Try the agent before you pay anything
The agent that will answer your customers is the one answering you now: ask it from the chat button here or on WhatsApp. Your account is free with no credit card, and the free trial on your own number or page is activated after you contact our team on customer-service WhatsApp.