WhatsApp Business API
Sends a WhatsApp template or free-form message from your business number and returns a message ID, then sent, delivered and read statuses by webhook.
- Source
- Meta WhatsApp Business Platform
- Turnaround
- Usually delivered within seconds
- Endpoint
- POST /v1/whatsapp/messages
- Who can use it
- Businesses with a verified Meta Business account, an approved display name and opted-in recipients. Templates must be approved by Meta.
Overview
Customers read WhatsApp messages far more often than SMS or email. The WhatsApp Business API lets you send Meta-approved template messages (KYC reminders, loan updates, documents) and reply freely within the 24-hour customer service window. We handle set-up of your number, template approval and delivery and read receipts.
Good to know
You can only start conversations with approved templates, and only with users who opted in. Meta can limit numbers that get many blocks or reports.
What you get
- Your own numberMessages come from your verified business name, not a shared number.
- Template helpWe help you write templates Meta will approve and pick the right category.
- Documents and mediaSend sanction letters, receipts and statements as PDFs.
- Delivery and read statusSent, delivered, read and failed statuses by webhook.
Request
POST https://api.ampletrails.com/v1/whatsapp/messages
| Field | Type | Status | Description |
|---|---|---|---|
to | string | Required | Recipient WhatsApp number with country code |
template_name | string | Optional | Approved template to send (required to start a conversation) |
language | string | Optional | Template language code |
variables | array | Optional | Values for template placeholders |
text | string | Optional | Free-form reply, allowed within an open customer-service window |
media_url | string | Optional | Image or document to attach |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
message_id | WhatsApp message identifier | wamid.HBgM… |
status | accepted, sent, delivered, read or failed | accepted |
conversation_category | Meta conversation category (utility, authentication, marketing, service) | utility |
error | Error details if the message failed | null |
sent_at | Time the message was accepted for sending | 2026-12-04T10:15:22+05:30 |
Example
curl -X POST https://api.ampletrails.com/v1/whatsapp/messages \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "919876543210", "template_name": "kyc_reminder", "language": "en", "variables": "[\"Ravi\",\"https://verify.example/j/abc\"]", "text": "Thanks Ravi, your KYC is complete.", "media_url": "https://example.com/sanction-letter.pdf"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/whatsapp/messages",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"to": "919876543210",
"template_name": "kyc_reminder",
"language": "en",
"variables": "[\"Ravi\",\"https://verify.example/j/abc\"]",
"text": "Thanks Ravi, your KYC is complete.",
"media_url": "https://example.com/sanction-letter.pdf"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/whatsapp/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "919876543210",
"template_name": "kyc_reminder",
"language": "en",
"variables": "[\"Ravi\",\"https://verify.example/j/abc\"]",
"text": "Thanks Ravi, your KYC is complete.",
"media_url": "https://example.com/sanction-letter.pdf"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/whatsapp/messages");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["to" => "919876543210", "template_name" => "kyc_reminder", "language" => "en", "variables" => "[\"Ravi\",\"https://verify.example/j/abc\"]", "text" => "Thanks Ravi, your KYC is complete.", "media_url" => "https://example.com/sanction-letter.pdf"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"message_id": "wamid.HBgM…",
"status": "accepted",
"conversation_category": "utility",
"error": null,
"sent_at": "2026-12-04T10:15:22+05:30"
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
KYC and document reminders
Nudge customers who haven't finished onboarding, with a link to continue.
Loan servicing
EMI reminders, receipts and statements on the app customers already use.
Support
Answer customer questions in the same chat as their alerts.
Questions about this API
What does Meta need from us?
A verified Meta Business account, a phone number not already on WhatsApp, and a display name that matches your business. We'll walk you through it.
How long does template approval take?
Often within a day. Templates are rejected if they look promotional in a utility category or have unclear variables.
How are conversations charged?
Meta charges per conversation or message depending on the category (marketing, utility, authentication, service) under its current pricing. We pass on Meta's charges as agreed in your quote.
Can we message anyone?
Only people who have opted in to receive WhatsApp messages from you. Sending unwanted messages gets numbers restricted quickly.
Try the WhatsApp Business API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.