Skip to content

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

Step-by-step

  1. Get phoneNumberId
    Call GET /v2/me and copy a Meta phoneNumberId.

  2. List or get the template
    GET /v2/templates (optional phoneNumberId or accountId query). GET /v2/templates/:name loads up to 200 Meta templates and exact-matches the name.

  3. Build components
    POST /v2/templates/send does not apply template example values. Pass real components for variables and media. Media headers need a mediaId from upload.

  4. Send
    POST /v2/templates/send with templateName, phoneNumberId, and to or recipient. Authentication (OTP) templates require to. 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.