WhatsApp API for developers
Send WhatsApp messages and templates from your own app, keep contacts in sync, and get every message and delivery update on your server in real time — on the official WhatsApp Business Platform.
Get started
- Create an account and connect your WhatsApp number (Pro plan for the API).
- Dashboard → API Platform → create an API key. It's shown once; keep it on your server.
- Copy your WhatsApp number's ID from the same page, and get a template approved under Templates.
- Call the API with
Authorization: Bearer <your key>. Base URL:https://api.btavtechnologies.com/api/v1/platform
Every response is JSON: {"success": true, "data": …, "error": null}, or success: false with an error.code and a readable error.message.
Send a template message
Templates can be sent at any time. Variables fill {{1}}, {{2}}… in order. Add an Idempotency-Key so a retry never sends twice.
curl -X POST https://api.btavtechnologies.com/api/v1/platform/template-messages \
-H "Authorization: Bearer wsk_xxxxxxxx.yyyyyyyyyyyy" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042-confirmation" \
-d '{
"phone_number_id": "<your number's ID from API Platform>",
"to": "919876543210",
"template_name": "order_confirmation",
"variables": ["Asha", "#1042"]
}'Endpoints
| POST | /template-messages | Send an approved template — works any time (order updates, OTPs, reminders). |
| POST | /messages | Send a text message (only within 24 hours of the customer's last message). |
| GET | /messages/{id} | A message's delivery status: SENT, DELIVERED, READ or FAILED (with the reason). |
| POST | /contacts | Create a contact (name, phone, email, tags, custom fields). |
| GET | /contacts | List contacts. |
| GET | /campaigns | List campaigns and their status. |
| GET | /usage | Wallet balance and this month's message counts. |
| POST | /hooks | Subscribe a URL to one event (REST hooks, used by Zapier). |
| DELETE | /hooks/{id} | Unsubscribe that URL. |
Full request and response details (OpenAPI): api.btavtechnologies.com/api/docs.
Webhooks — events to your server
Dashboard → API Platform → Webhooks: add your URL and choose events. We POST JSON to it, signed with the webhook's secret in X-Webhook-Signature (sha256= + HMAC-SHA256 of the raw body). Failed deliveries are retried with back-off.
| message.received | A customer sent you a WhatsApp message. |
| message.sent / delivered / read / failed | Delivery updates for messages you sent. |
| contact.created | A new contact was added (by hand, import, form or a new chat). |
| form.submitted | A customer filled in a WhatsApp Form. |
| order.created | A new order from your Shopify or WooCommerce store. |
| payment_link.paid | A payment link sent in a chat was paid. |
| campaign.completed | A campaign finished sending. |
| template.updated | Meta approved or rejected a template. |
| whatsapp.connected / disconnected | Your WhatsApp number's connection changed. |
| payment.success / payment.failed | Plan or wallet payments. |
import hashlib, hmac
def is_from_btav(raw_body: bytes, signature_header: str, secret: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature_header or "")Limits & errors
- 60 requests a minute per API key; over that you get HTTP 429 — wait and retry.
- Text messages (
/messages) only reach customers who wrote to you in the last 24 hours; use a template otherwise. - Opted-out customers (they replied STOP) can't be messaged — the API refuses with a clear error.
- WhatsApp's own errors come back in plain words in
error.messageand on the message'serror_message.
No-code instead? Use Zapier, Pabbly, Make or our incoming connectors — see Integrations.