Messages
Send WhatsApp Template
Send a pre-approved WhatsApp template message to initiate a conversation
POST
Overview
Sends a pre-approved WhatsApp message template to a recipient using your agent’s connected WhatsApp Business number. Use this to initiate conversations outside the 24-hour messaging window.Templates must be approved by Meta before use. Your template must comply with Meta’s template guidelines — templates that don’t conform will be rejected or recategorized. Manage your templates in Meta Business Manager → WhatsApp Manager → Message Templates.
Request
Headers
Bearer token for authentication.
Must be
application/jsonBody Parameters
The UUID of the agent whose connected WhatsApp number will send the message.Example:
"d920763c-59d8-490e-ad69-b6a3295e23a8"The recipient’s phone number in E.164 format.Example:
"+16045628647"The exact name of your approved Meta template. Must match a template approved in your WhatsApp Business account.See Meta’s template guidelines for categorization rules.Example:
"upcoming_site_report"The language code for the template. Defaults to
en_US.Example: "en_US"Optional array of template component objects for passing variable values. Required if your template has dynamic variables.Each component maps to a section of your template (With header and body variables:With a URL button variable — buttons require See Meta’s template component docs for the full component structure including quick reply buttons, images, and documents.
body, header, or button). Parameters are positional — the first parameter fills {{1}}, the second fills {{2}}, and so on, in the order they appear in your approved template.Body variables example — for a template with Hello {{1}}, your report for {{2}} on {{3}} is ready:sub_type and index (zero-based position of the button in the template):Optional arbitrary JSON object (must be a plain object — arrays are ignored) stored against this message. When the recipient replies to the conversation this template opens, Magpipe echoes this
metadata back on the inbound event so you can attribute the reply to your own record (e.g. a schedule, project, or ticket). Because the template is the conversation opener, attaching metadata here is the recommended way to tag the whole thread.Example: { "schedule_id": "sch_123", "project_id": "proj_456" }Response
Whether the template was sent successfully.
The WhatsApp message ID returned by Meta.