Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
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
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
id
meta_template_id
name
category
UTILITY
MARKETING
AUTHENTICATION
status
language
en_US
header_type
TEXT
IMAGE
VIDEO
DOCUMENT
components
rejection_reason
tpl.approved? # => true tpl.pending? # => false tpl.rejected? # => false