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

  1. Create an account and connect your WhatsApp number (Pro plan for the API).
  2. Dashboard → API Platform → create an API key. It's shown once; keep it on your server.
  3. Copy your WhatsApp number's ID from the same page, and get a template approved under Templates.
  4. 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-messagesSend an approved template — works any time (order updates, OTPs, reminders).
POST/messagesSend 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/contactsCreate a contact (name, phone, email, tags, custom fields).
GET/contactsList contacts.
GET/campaignsList campaigns and their status.
GET/usageWallet balance and this month's message counts.
POST/hooksSubscribe 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.receivedA customer sent you a WhatsApp message.
message.sent / delivered / read / failedDelivery updates for messages you sent.
contact.createdA new contact was added (by hand, import, form or a new chat).
form.submittedA customer filled in a WhatsApp Form.
order.createdA new order from your Shopify or WooCommerce store.
payment_link.paidA payment link sent in a chat was paid.
campaign.completedA campaign finished sending.
template.updatedMeta approved or rejected a template.
whatsapp.connected / disconnectedYour WhatsApp number's connection changed.
payment.success / payment.failedPlan 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.message and on the message's error_message.

No-code instead? Use Zapier, Pabbly, Make or our incoming connectors — see Integrations.