Developers
API guides
Before you start
- Connect your WhatsApp number in the app (WhatsApp numbers).
- Create the template from the recipe under Templates (or pick a similar one from the library) and submit it. WhatsApp usually approves Utility templates within minutes to a few hours. Only approved templates can be sent.
- Create an API key under Developer → API keys with the scopes you need (
messages:send,messages:read,contacts:write,templates:read,otp…). Start with a sandbox key (wsk_test_…): it runs every check but sends nothing and costs nothing. - Keep the key on your server only (never in a browser or mobile app). The examples read it from the
WASAAS_KEYenvironment variable. - Check which variables a template needs:
GET /v1/templateslists every approved template with itsvariables(e.g.body.1,button.0.1), its header type and its body text.
curl
curl -X GET https://whatsapp.unimanage.in/api/v1/templates \
-H "Authorization: Bearer $WASAAS_KEY"Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/templates", {
method: "GET",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/templates");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.get(
"https://whatsapp.unimanage.in/api/v1/templates",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Consent: business-initiated messages go only to people who agreed to get them. Send opt_in.proof (where and when they agreed: loan agreement number, checkout form, signup form) the first time you message a new number, or add them as contacts with consent first. People who reply STOP are opted out automatically.
EMI / loan instalment reminder
For NBFCs, lenders, finance and consumer-durable companies. Run it from a daily job: find instalments due in 3 days (and on the due date) and send one message each.
emi_due_reminderCategory: UTILITYHi {{1}}, your EMI of {{2}} for loan account {{3}} is due on {{4}}. Please keep the amount ready in your bank account or pay online to avoid late charges.
Button: URL “Pay now” → https://pay.yourcompany.in/emi/{{1}}
Fill body.1…body.4 and the button's link part button.0.1. Use an Idempotency-Key made of the loan and due date so a job that runs twice never sends twice.
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: emi-LN1042-2026-12-05" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "emi_due_reminder",
"language": "en",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "LN1042",
"body.4": "5 Dec 2026",
"button.0.1": "LN1042"
},
"opt_in": {
"proof": "Loan agreement LN1042, WhatsApp consent clause"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "emi-LN1042-2026-12-05" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "emi_due_reminder",
"language": "en",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "LN1042",
"body.4": "5 Dec 2026",
"button.0.1": "LN1042"
},
"opt_in": {
"proof": "Loan agreement LN1042, WhatsApp consent clause"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: emi-LN1042-2026-12-05"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "emi_due_reminder",
"language" => "en",
"values" => [
"body.1" => "Ravi",
"body.2" => "₹4,250",
"body.3" => "LN1042",
"body.4" => "5 Dec 2026",
"button.0.1" => "LN1042"
],
"opt_in" => [
"proof" => "Loan agreement LN1042, WhatsApp consent clause"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "emi-LN1042-2026-12-05"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "emi_due_reminder",
"language": "en",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "LN1042",
"body.4": "5 Dec 2026",
"button.0.1": "LN1042"
},
"opt_in": {
"proof": "Loan agreement LN1042, WhatsApp consent clause"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)The answer is 202 with the message id and status: "queued". Save the id against the instalment; delivery and read receipts arrive by webhook. For an overdue instalment use a second template ("your EMI of {{2}} was due on {{3}}…"). Keep the tone factual: threatening or abusive collection messages get numbers blocked by WhatsApp.
School fees, bills and rent due
The same pattern works for any due amount: school and coaching fees, society maintenance, rent, electricity or broadband bills, insurance premiums, subscription renewals.
payment_dueCategory: UTILITYHi {{1}}, this is a reminder that {{2}} of {{3}} is due on {{4}}. You can pay using the link below. Ignore this message if you have already paid.
Button: URL “Pay now” → https://pay.yourcompany.in/{{1}}
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: fees-STU221-2026-12" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "payment_due",
"values": {
"body.1": "Mrs. Sharma",
"body.2": "the December tuition fee",
"body.3": "₹6,500",
"body.4": "10 Dec 2026",
"button.0.1": "STU221-DEC"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "fees-STU221-2026-12" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "payment_due",
"values": {
"body.1": "Mrs. Sharma",
"body.2": "the December tuition fee",
"body.3": "₹6,500",
"body.4": "10 Dec 2026",
"button.0.1": "STU221-DEC"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: fees-STU221-2026-12"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "payment_due",
"values" => [
"body.1" => "Mrs. Sharma",
"body.2" => "the December tuition fee",
"body.3" => "₹6,500",
"body.4" => "10 Dec 2026",
"button.0.1" => "STU221-DEC"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "fees-STU221-2026-12"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "payment_due",
"values": {
"body.1": "Mrs. Sharma",
"body.2": "the December tuition fee",
"body.3": "₹6,500",
"body.4": "10 Dec 2026",
"button.0.1": "STU221-DEC"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Sending to hundreds of people at once on a fixed date? Tag them (e.g. fees-december) with POST /v1/contacts and start one POST /v1/campaigns instead: it paces sending to your number's limits and gives you a report. See Campaigns.
Invoice or bill as a PDF
Send the actual PDF on WhatsApp: GST invoices, bills, statements, policy documents, tickets.
invoice_pdfCategory: UTILITYHeader: DOCUMENT (upload any sample PDF when you create it)Hi {{1}}, thank you for your purchase. Your invoice {{2}} for {{3}} is attached. Please contact us if anything looks wrong.
Step 1 – upload the PDF (up to 100 MB). You get a media_key:
curl -X POST https://whatsapp.unimanage.in/api/v1/media \
-H "Authorization: Bearer $WASAAS_KEY" \
-F "file=@INV-2026-1042.pdf"
→ 201 {"media_key": "ws/7/outbox/.../INV-2026-1042.pdf", "type": "document", "mime": "application/pdf", ...}Upload in Node.js, PHP, Python
// Node.js 18+
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("file", new Blob([await readFile("INV-2026-1042.pdf")], { type: "application/pdf" }), "INV-2026-1042.pdf");
const up = await (await fetch("https://whatsapp.unimanage.in/api/v1/media", {
method: "POST", headers: { Authorization: `Bearer ${process.env.WASAAS_KEY}` }, body: form,
})).json();
<?php // PHP
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/media");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY")],
CURLOPT_POSTFIELDS => ["file" => new CURLFile("INV-2026-1042.pdf", "application/pdf")]]);
$up = json_decode(curl_exec($ch), true);
# Python
up = requests.post("https://whatsapp.unimanage.in/api/v1/media",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}"},
files={"file": ("INV-2026-1042.pdf", open("INV-2026-1042.pdf", "rb"), "application/pdf")}).json()Step 2 – send the template with that media_key as its header. The customer sees your file name.
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: invoice-INV-2026-1042" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "invoice_pdf",
"media_key": "ws/7/outbox/.../INV-2026-1042.pdf",
"values": {
"body.1": "Ravi",
"body.2": "INV-2026-1042",
"body.3": "₹2,360"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "invoice-INV-2026-1042" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "invoice_pdf",
"media_key": "ws/7/outbox/.../INV-2026-1042.pdf",
"values": {
"body.1": "Ravi",
"body.2": "INV-2026-1042",
"body.3": "₹2,360"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: invoice-INV-2026-1042"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "invoice_pdf",
"media_key" => "ws/7/outbox/.../INV-2026-1042.pdf",
"values" => [
"body.1" => "Ravi",
"body.2" => "INV-2026-1042",
"body.3" => "₹2,360"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "invoice-INV-2026-1042"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "invoice_pdf",
"media_key": "ws/7/outbox/.../INV-2026-1042.pdf",
"values": {
"body.1": "Ravi",
"body.2": "INV-2026-1042",
"body.3": "₹2,360"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Within 24 hours of the customer's last message you may also send the file without a template: {"type": "document", "media_key": "…", "text": "Your invoice"}. Outside that window only a template works.
Payment received / receipt
payment_receivedCategory: UTILITYHi {{1}}, we have received your payment of {{2}} on {{3}} (reference {{4}}). Thank you!
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: receipt-pay_Nx81Kq2" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "payment_received",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "3 Dec 2026",
"body.4": "pay_Nx81Kq2"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "receipt-pay_Nx81Kq2" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "payment_received",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "3 Dec 2026",
"body.4": "pay_Nx81Kq2"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: receipt-pay_Nx81Kq2"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "payment_received",
"values" => [
"body.1" => "Ravi",
"body.2" => "₹4,250",
"body.3" => "3 Dec 2026",
"body.4" => "pay_Nx81Kq2"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "receipt-pay_Nx81Kq2"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "payment_received",
"values": {
"body.1": "Ravi",
"body.2": "₹4,250",
"body.3": "3 Dec 2026",
"body.4": "pay_Nx81Kq2"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Call it from your payment gateway's success webhook. Using the gateway's payment id as the Idempotency-Key makes repeated gateway webhooks harmless.
OTP login or verification
Create an Authentication template (the library has one; WhatsApp fixes its text). We create the 6-digit code, send it and check it, so you never store codes. A code lasts 5 minutes with 3 tries.
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/otp/send \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"template_name": "login_otp"
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/otp/send", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"to": "+919876543210",
"template_name": "login_otp"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/otp/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"template_name" => "login_otp"
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/otp/send",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}"},
json={
"to": "+919876543210",
"template_name": "login_otp"
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Keep the otp_id from the answer in the user's session, then check what they typed:
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/otp/verify \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Content-Type: application/json" \
-d '{
"otp_id": 902,
"code": "483920"
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/otp/verify", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"otp_id": 902,
"code": "483920"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/otp/verify");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"otp_id" => 902,
"code" => "483920"
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/otp/verify",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}"},
json={
"otp_id": 902,
"code": "483920"
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data){"verified": true} → log them in. {"verified": false, "reason": "wrong_code", "attempts_left": 2} → ask again; expired / too_many_attempts / already_used → send a new code. With a sandbox key the answer includes sandbox_code.
Order confirmed, shipped, delivered
Shopify or WooCommerce? Use Integrations in the app instead: no code. For your own shop or ERP, send one template per step with a tracking link:
order_shipped_trackingCategory: UTILITYHi {{1}}, your order {{2}} has been shipped with {{3}}. Tracking number: {{4}}.
Button: URL “Track order” → https://track.yourcompany.in/{{1}}
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: order-1042-shipped" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "order_shipped_tracking",
"values": {
"body.1": "Asha",
"body.2": "#1042",
"body.3": "Delhivery",
"body.4": "DL1234567890",
"button.0.1": "DL1234567890"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "order-1042-shipped" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "order_shipped_tracking",
"values": {
"body.1": "Asha",
"body.2": "#1042",
"body.3": "Delhivery",
"body.4": "DL1234567890",
"button.0.1": "DL1234567890"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: order-1042-shipped"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "order_shipped_tracking",
"values" => [
"body.1" => "Asha",
"body.2" => "#1042",
"body.3" => "Delhivery",
"body.4" => "DL1234567890",
"button.0.1" => "DL1234567890"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "order-1042-shipped"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "order_shipped_tracking",
"values": {
"body.1": "Asha",
"body.2": "#1042",
"body.3": "Delhivery",
"body.4": "DL1234567890",
"button.0.1": "DL1234567890"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)Cash on delivery? POST /v1/orders/confirmations sends a Confirm / Cancel message and tells you the answer. See COD confirmations.
Appointment or visit reminder
Clinics, salons, service centres, coaching demos. If you book through our Appointments API, reminders go out automatically. If bookings live in your own software, send this the day before:
appointment_reminder_dayCategory: UTILITYHi {{1}}, this is a reminder of your appointment for {{2}} on {{3}} at {{4}}. Reply to this message if you need to change it.
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/messages \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Idempotency-Key: appt-7781-reminder" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template_name": "appointment_reminder_day",
"values": {
"body.1": "Ravi",
"body.2": "Dental check-up",
"body.3": "12 Dec",
"body.4": "10:30 AM"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/messages", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "appt-7781-reminder" },
body: JSON.stringify({
"to": "+919876543210",
"type": "template",
"template_name": "appointment_reminder_day",
"values": {
"body.1": "Ravi",
"body.2": "Dental check-up",
"body.3": "12 Dec",
"body.4": "10:30 AM"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json", "Idempotency-Key: appt-7781-reminder"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+919876543210",
"type" => "template",
"template_name" => "appointment_reminder_day",
"values" => [
"body.1" => "Ravi",
"body.2" => "Dental check-up",
"body.3" => "12 Dec",
"body.4" => "10:30 AM"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}", "Idempotency-Key": "appt-7781-reminder"},
json={
"to": "+919876543210",
"type": "template",
"template_name": "appointment_reminder_day",
"values": {
"body.1": "Ravi",
"body.2": "Dental check-up",
"body.3": "12 Dec",
"body.4": "10:30 AM"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)New customer from your website or app form
Save the contact with their consent (and tags / custom fields for later campaigns), then send a welcome template.
curl
curl -X POST https://whatsapp.unimanage.in/api/v1/contacts \
-H "Authorization: Bearer $WASAAS_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"name": "Ravi Patil",
"email": "ravi@example.com",
"tags": [
"website",
"loan-enquiry"
],
"custom_fields": {
"city": "Pune",
"loan_amount": "300000"
},
"opt_in": {
"proof": "Enquiry form on yourcompany.in, 20 Nov 2026 10:14, WhatsApp checkbox ticked"
}
}'Node.js
// Node.js 18+ (built-in fetch)
const res = await fetch("https://whatsapp.unimanage.in/api/v1/contacts", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.WASAAS_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"phone": "+919876543210",
"name": "Ravi Patil",
"email": "ravi@example.com",
"tags": [
"website",
"loan-enquiry"
],
"custom_fields": {
"city": "Pune",
"loan_amount": "300000"
},
"opt_in": {
"proof": "Enquiry form on yourcompany.in, 20 Nov 2026 10:14, WhatsApp checkbox ticked"
}
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);PHP
<?php
$ch = curl_init("https://whatsapp.unimanage.in/api/v1/contacts");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WASAAS_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"phone" => "+919876543210",
"name" => "Ravi Patil",
"email" => "ravi@example.com",
"tags" => ["website", "loan-enquiry"],
"custom_fields" => [
"city" => "Pune",
"loan_amount" => "300000"
],
"opt_in" => [
"proof" => "Enquiry form on yourcompany.in, 20 Nov 2026 10:14, WhatsApp checkbox ticked"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data["error"]["code"] . ": " . $data["error"]["message"]); }
print_r($data);Python
import os, requests
res = requests.post(
"https://whatsapp.unimanage.in/api/v1/contacts",
headers={"Authorization": f"Bearer {os.environ['WASAAS_KEY']}"},
json={
"phone": "+919876543210",
"name": "Ravi Patil",
"email": "ravi@example.com",
"tags": [
"website",
"loan-enquiry"
],
"custom_fields": {
"city": "Pune",
"loan_amount": "300000"
},
"opt_in": {
"proof": "Enquiry form on yourcompany.in, 20 Nov 2026 10:14, WhatsApp checkbox ticked"
}
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)201 = new contact, 200 = updated. Custom fields can fill template variables automatically if you map them in the template's "Fill variables from contacts" card in the app.
Customer replies and delivery status
Add your HTTPS URL under Developer → Webhooks. You get message.status (sent / delivered / read / failed) and message.received (the customer wrote back, e.g. "PAID" or a question). Always check the signature first:
// Node.js + Express
import crypto from "node:crypto";
import express from "express";
const app = express();
app.post("/whatsapp-hook", express.raw({ type: "application/json" }), (req, res) => {
const parts = Object.fromEntries(req.get("X-WaSaaS-Signature").split(",").map((p) => p.split("=")));
const expected = crypto.createHmac("sha256", process.env.WASAAS_WEBHOOK_SECRET)
.update(`${parts.t}.`).update(req.body).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
if (!fresh || !crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1))) {
return res.sendStatus(401);
}
res.sendStatus(200); // answer fast, work afterwards
const event = JSON.parse(req.body);
if (event.event === "message.status") {
// update your record: event.data.id (message id), event.data.status, event.data.error
} else if (event.event === "message.received") {
// a reply: show it to your team, or match "PAID", "CALL ME"...
}
});
app.listen(3000);<?php // PHP
$raw = file_get_contents("php://input");
parse_str(str_replace(",", "&", $_SERVER["HTTP_X_WASAAS_SIGNATURE"] ?? ""), $p);
$expected = hash_hmac("sha256", $p["t"] . "." . $raw, getenv("WASAAS_WEBHOOK_SECRET"));
if (abs(time() - (int)$p["t"]) > 300 || !hash_equals($expected, $p["v1"] ?? "")) {
http_response_code(401); exit;
}
http_response_code(200);
$event = json_decode($raw, true);
// $event["event"], $event["data"]["id"], $event["data"]["status"] ...Python verification is on the reference page. Events can arrive twice: de-duplicate on data.id + data.status. Failed deliveries are retried for about 2.5 hours and can be re-sent from the delivery log.
Go-live checklist
- Tested everything with a sandbox key, then switched to a live key (
wsk_live_…) with only the scopes you use and your server IPs. - Every send has an
Idempotency-Keymade from your own record (loan + due date, invoice number, order + step). - Your code branches on
error.code:low_wallet(top up),opted_out/no_consent/recipient_on_hold/marketing_stopped(don't retry),template_not_found/missing_variables(fix the call),rate_limited(waitRetry-After). Full list on the reference page. - Messages go only to customers who agreed, and you store where that consent came from.
- The webhook checks the signature and answers within a few seconds.
- The wallet has enough balance:
GET /v1/account/balance(100 paise = ₹1). Utility template messages are charged when queued and refunded if they fail.
Prefer clicking? Import the Postman collection. Stuck? Write to unimanagesoftware@gmail.com with the request_id from the error.
Go live on WhatsApp this week
Sign up, connect your own number in a few clicks and send your first campaign. No setup fee, no card for the trial.