Sending Template Messages

How to send template messages via Cloud API with variables, media headers, and URL buttons.

Standard Send Endpoint

Send template messages through:

POST /<PHONE_NUMBER_ID>/messages

Utility Template with Variables

{
  "messaging_product": "whatsapp",
  "to": "12015550123",
  "type": "template",
  "template": {
    "name": "order_update_v1",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Alex" },
          { "type": "text", "text": "A12345" },
          { "type": "text", "text": "shipped" }
        ]
      }
    ]
  }
}

Template with Media Header

{
  "messaging_product": "whatsapp",
  "to": "12015550123",
  "type": "template",
  "template": {
    "name": "delivery_photo_update",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": { "id": "123456789012345" }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Alex" },
          { "type": "text", "text": "A12345" }
        ]
      }
    ]
  }
}

For media upload, see Upload, Retrieve & Delete Media.

URL Button Parameter

{
  "messaging_product": "whatsapp",
  "to": "12015550123",
  "type": "template",
  "template": {
    "name": "track_order_button",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Alex" },
          { "type": "text", "text": "A12345" }
        ]
      },
      {
        "type": "button",
        "sub_type": "url",
        "index": "0",
        "parameters": [
          { "type": "text", "text": "A12345" }
        ]
      }
    ]
  }
}

Send Responses

Successful send:

{
  "messages": [
    {
      "id": "wamid.HBgLMTIzNDU2Nzg5FQIAERgS...",
      "message_status": "accepted"
    }
  ]
}

Held for quality assessment:

{
  "messages": [
    {
      "id": "wamid.HBgLMTIzNDU2Nzg5FQIAERgS...",
      "message_status": "held_for_quality_assessment"
    }
  ]
}

Dualhook manages template operations and management-event visibility but does not change Meta review outcomes, category assignment, or send eligibility decisions. For error codes, see Meta API Error Reference.

Related

  • TemplatesTemplate lifecycle, categories, and management through Dualhook and Meta Graph API.
  • Template ElementsTemplate structure: headers, body, footer, buttons, variables, and practical limits.
  • Messaging OverviewCore messaging endpoint, text messages, formatting, delivery statuses, and common errors.
Browse more docsGet started with Dualhook