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.data.first
templates = account.templates
# or:
templates = client.templates(account.id)
result = templates.list
result.data # => Array 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")
tpl&.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 # => Array 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 | String | WhatsRB template ID |
meta_template_id | String | Meta template ID |
name | String | Template name |
category | String | UTILITY, MARKETING, AUTHENTICATION |
status | String | approved, pending, rejected |
language | String | Language code (e.g. en_US) |
header_type | String | TEXT, IMAGE, VIDEO, DOCUMENT |
components | Array | Template components |
rejection_reason | String | Reason if rejected |
tpl.approved? # => true
tpl.pending? # => false
tpl.rejected? # => false
