BusinessAccount or directly via the client.
List templates
approved, pending, rejected.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create, sync, and manage WhatsApp message templates.
BusinessAccount or directly via the client.
account = client.business_accounts.list()[0]
templates = account.templates()
# or:
templates = client.templates(account.id)
result = templates.list()
result.data # list of Template objects
# Filter by status or category
result = templates.list(status="approved")
result = templates.list(status="approved", category="MARKETING")
approved, pending, rejected.
tpl = templates.find_by_name("order_confirmation")
if tpl:
print(tpl.is_approved) # True
tpl = templates.retrieve("tpl_01hx...")
tpl.name # "order_confirmation"
tpl.status # "approved"
tpl.language # "en_US"
tpl.category # "UTILITY"
tpl = templates.create(
name="order_confirmation",
category="UTILITY",
language="en_US",
components=[
{
"type": "BODY",
"text": "Your order {{1}} has been confirmed.",
}
],
)
tpl.status # "pending" (awaiting Meta approval)
result = templates.sync()
result.data # list of synced Template objects
clone = templates.clone("tpl_01hx...")
clone.name # "order_confirmation_copy"
msg = templates.send_test(
"tpl_01hx...",
to="+33699887766",
variables=["ORDER-123"],
)
msg.status # "queued"
templates.delete("tpl_01hx...") # True
| Attribute | Type | Description |
|---|---|---|
id | str | WhatsRB template ID |
meta_template_id | str | Meta template ID |
name | str | Template name |
category | str | UTILITY, MARKETING, AUTHENTICATION |
status | str | approved, pending, rejected |
language | str | Language code (e.g. en_US) |
header_type | str | TEXT, IMAGE, VIDEO, DOCUMENT |
components | list | Template components |
rejection_reason | str | Reason if rejected |
tpl.is_approved # True
tpl.is_pending # False
tpl.is_rejected # False
