Templates
A template is a message Meta has reviewed and approved in advance. It is the only thing you can send to someone who hasn’t messaged you recently, which makes it the starting point of every WhatsApp integration.
GEThttps://api.9bits.net/whatsapp/ng/v1/whatsapp/templates
curl https://api.9bits.net/whatsapp/ng/v1/whatsapp/templates \ -H "Authorization: Bearer $NINEBITS_WA_KEY"[ { "name": "order_shipped", "language": "en", "category": "UTILITY", "status": "APPROVED", "header_type": "none", "body_text": "Hi {{1}}, your order {{2}} has shipped.", "variables_count": 2, "variable_names": [ { "name": "Customer name", "example": "Jane" }, { "name": "Order number", "example": "AB123" } ] }]A template is addressed by name and language
Section titled “A template is addressed by name and language”There is no template id to pass. A send names template_name + language, and
both must match exactly.
Only APPROVED can be sent
Section titled “Only APPROVED can be sent”status | What it means |
|---|---|
APPROVED | Sendable. |
PENDING | Submitted, awaiting Meta. Minutes for utility and authentication; longer for marketing, sometimes indefinitely. |
REJECTED | Meta refused it. Fix the copy and submit a new one — a rejection is final for that version. |
Approval is per sending number
Section titled “Approval is per sending number”Meta approves a template for one of your WhatsApp numbers, not for your account as a whole. If you have more than one number, the same template can be approved for one and pending for another, and a number can only send what was approved for it.
That is why a send can be refused with a template you can plainly see is
APPROVED — it is approved, just not for the number the message went out from.
Pass wa_account_id explicitly and the ambiguity disappears:
{ "to": "2348020000000", "wa_account_id": 6, "message_type": "template", "template_name": "order_shipped", "language": "en", "params": ["Jane", "AB123"]}wa_account_id is the id from List senders.
variables_count is the number to match
Section titled “variables_count is the number to match”params fills the template’s {{1}}, {{2}} … placeholders in array order, and
the count must equal variables_count. Send a different number and the message
is refused before you are billed.
Categories set the price
Section titled “Categories set the price”| Category | Typical use |
|---|---|
UTILITY | Order updates, receipts, appointment reminders. |
AUTHENTICATION | One-time codes. Meta writes the copy; you supply the code. |
MARKETING | Promotions, offers, anything selling. The expensive one. |
The category is fixed by the template, so you commit to the price when you pick which template to send — not at send time. See Broadcasts to price a send before committing to it.
Getting a template approved
Section titled “Getting a template approved”Templates are authored in the dashboard, not through this API. What matters for your integration is the timing: