How to send a template via API v2
API template send is how you message a contact outside the 24-hour window from code. Authenticate, list templates with GET /v2/templates, then POST /v2/templates/send. Field details are in Templates.
Prerequisites
- An API token on Premium or Enterprise. See How to generate an API token.
- A Meta-approved template on that line. See How to create a WhatsApp message template.
Step-by-step
Get phoneNumberId
Call GET /v2/me and copy a MetaphoneNumberId.List or get the template
GET /v2/templates (optionalphoneNumberIdoraccountIdquery). GET /v2/templates/:name loads up to 200 Meta templates and exact-matches the name.Build components
POST /v2/templates/send does not apply templateexamplevalues. Pass realcomponentsfor variables and media. Media headers need a mediaId from upload.Send
POST /v2/templates/send withtemplateName,phoneNumberId, andtoorrecipient. Authentication (OTP) templates requireto. See curl examples on Templates.
TIP
Create and wait for Meta approval in the dashboard first. The API sends existing templates; it does not replace Create Template.
FAQ
Why is GET /v2/templates/:name 404?
The name may exist outside the first 200 Meta templates loaded. Search with list paging, or send with the known name.
Can I test-send without a customer number?
POST /v2/templates/:name/test-send exists for tests. Production sends use POST /v2/templates/send.
Blocked contact?
403 FORBIDDEN and Meta is not called. Unblock in the inbox first.