WpAi API
What this is
WpAi connects a business to WhatsApp two ways: the official Cloud API, and WhatsApp Web paired by QR code. They differ in real ways — one bills per approved template message and needs one outside a 24-hour window, the other sends free text at one message a second — but the API in front of them is the same shape.
Everything below is addressed to https://api.wpai.co.in. Requests and responses are JSON unless a route is explicitly multipart or a CSV download.
Three surfaces
Which one you want depends on where your code runs, and it decides which kind of API key you create.
- Server to server — your backend calling
/api/messages/sendand/api/templates. Needs a key with themessages:sendscope. - Website widget — a browser calling
/api/public/*for assistant chat and bookings. Needs a widget-scoped key, which is safe to publish in page source and is refused everywhere else. - Webhooks — us calling you when a message arrives, a delivery status changes or Meta reviews a template.
Your first call
Create a key under Settings → API Keys with the messages:send scope. The full key is shown once. Then send a message to a number that has messaged you in the last 24 hours:
curl -X POST https://api.wpai.co.in/api/messages/send \
-H "X-API-Key: wpai_abc123.def456..." \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"channel": "whatsapp_cloud",
"type": "text",
"text": "Thanks for getting in touch — how can we help?"
}'A brand-new number will fail
Or start in Postman
Every request in these docs, ready to run. Import it, set baseUrl and apiKey, and send.
The Website widget folder is the exception — it wants a widget-scoped key rather than your server key. Override apiKey on that folder.
Where to go next
Authentication
API keys, the five scopes, and which kind of key is safe to publish.
Send overview
One endpoint, two channels, three success shapes. Read this first.
Managing templates
Create one over the API, and learn what Meta decided.
Webhooks
Every event, its payload, and how to verify a delivery came from us.
Website widget
The public API a browser may call: chat and bookings.
These pages cover integrating with WpAi — sending, templates and events. Running the business itself — campaigns, contacts, the shared inbox, reports — is done in the dashboard. If something here does not match what the API actually did, tell us: that is a bug in the documentation.