Skip to content

Custom marketing templates

Updated: Jun 17, 2026

Learn how to create and send a custom marketing template.

Custom marketing template preview with labeled image header, body, footer, URL, phone number, and quick-reply buttons

Supported components

Custom marketing templates support the following components:

  • 1 header (optional; all types supported)
  • 1 body (required)
  • 1 footer (optional)
  • Up to 10 buttons (optional; all types supported)

Step 1: Create a custom marketing template

Use the Message Templates API to create a custom marketing template.

Request syntax

This example syntax creates a template with an image header, body text with 3 named parameters, a footer, and 3 buttons (url, phone number, and quick-reply).

curl 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates' \  
-H 'Content-Type: application/json' \  
-H 'Authorization: Bearer <ACCESS_TOKEN>' \  
-d '  
{  
  "name": "<TEMPLATE_NAME>",  
  "language": "<TEMPLATE_LANGUAGE>",  
  "category": "marketing",  
  "parameter_format": "<PARAMETER_FORMAT>",  
  "components": [  
    {  
      "type": "header",  
      "format": "image",  
      "example": {  
        "header_handle": [  
          "<HEADER_ASSET_HANDLE>"  
        ]  
      }  
    },  
    {  
      "type": "body",  
      "text": "<BODY_TEXT>",  
      "example": {  
        "body_text_named_params": [  
          {  
            "param_name": "<BODY_PARAMETER_NAME>",  
            "example": "<BODY_PARAMETER_EXAMPLE_VALUE>"  
          },  
          <!-- additional parameters and example values go here -->  
        ]  
      }  
    },  
    {  
      "type": "footer",  
      "text": "<FOOTER_TEXT>"  
    },  
    {  
      "type": "buttons",  
      "buttons": [  
        {  
          "type": "url",  
          "text": "<URL_BUTTON_LABEL_TEXT>",  
          "url": "<URL_BUTTON_URL>"  
        },  
        {  
          "type": "phone_number",  
          "text": "<PHONE_NUMBER_BUTTON_LABEL_TEXT>",  
          "phone_number": "<PHONE_NUMBER_BUTTON_PHONE_NUMBER>"  
        },  
        {  
          "type": "quick_reply",  
          "text": "<QUICK_REPLY_BUTTON_LABEL_TEXT>"  
        }  
      ]  
    }  
  ]  
}'

Request parameters

PlaceholderDescriptionSample Value
<ACCESS_TOKEN> StringRequired. Access token.EAAAN6tcBzAUBOZC82CW7iR2LiaZBwUHS4Y7FDtQxRUPy1PHZClDGZBZCgWdrTisgMjpFKiZAi1FBBQNO2IqZBAzdZAA16lmUs0XgRcCf6z1LLxQCgLXDEpg80d41UZBt1FKJZCqJFcTYXJvSMeHLvOdZwFyZBrV9ZPHZASSqxDZBUZASyFdzjiy2A1sippEsF4DVV5W2IlkOSr2LrMLuYoNMYBy8xQczzOKDOMccqHEZD
<API_VERSION> StringOptional. API version. If omitted, defaults to the newest API version available to your app.v23.0
<BODY_PARAMETER_EXAMPLE_VALUE> StringRequired if using a body component string that includes one or more parameters. Example parameter value. You must supply an example for each parameter defined in your body component string.WELCOME20
<BODY_PARAMETER_NAME> StringRequired if using named parameters. Parameter name. You must supply a name for each parameter defined in your body component string. Must be a unique string, composed of lowercase characters and underscores, wrapped in double curly brackets.{​{discount_code}​}
<BODY_TEXT> StringRequired. Template body text. Variables are supported. Maximum 1024 characters.Welcome to Lucky Shrub, {​{first_name}​}!\\n\\nUse code *{​{discount_code}​}* to get {​{discount_amount}​} off of your first purchase!
<FOOTER_TEXT> StringOptional. Footer text. Maximum 60 characters.Lucky Shrub: Your gateway to succulents!
<PARAMETER_FORMAT> StringOptional. Parameter format. Value can be: * named * positional If the parameter_format property is omitted, the template will use positional formatting.Lucky Shrub: Your gateway to succulents!
<HEADER_ASSET_HANDLE> StringRequired if using a header with a media asset. Header media asset handle.4::aW1hZ2UvcG5n:ARYpf5zqqUjggwGfsZOJ2_o26Zs8ntcO2mss2vKpFb8P_IvskL043YXKpehYTD7IxqEB4t-uZcIzOTxOFRavEcN_tZLhk1WXFb3IOr4S8UKJcQ:e:1759093121:634974688087057:100089620928913:ARYyOAh63uQLhDpqOdk
<PHONE_NUMBER_BUTTON_LABEL_TEXT> StringRequired if using a phone number button. Button label text. Maximum 25 characters. Alphanumeric characters only.Call us
<PHONE_NUMBER_BUTTON_PHONE_NUMBER> StringRequired if using a phone number button component. Business phone number to be called in the WhatsApp user's default phone app when tapped by the user. Note that some countries have special phone numbers that have leading zeros after the country calling code (for example, +55-0-955-585-95436). If you assign one of these numbers to the button, the leading zero will be stripped from the number. If your number will not work without the leading zero, assign an alternate number to the button, or add the number as message body text. Maximum 20 characters. Alphanumeric characters only.15550051310
<QUICK_REPLY_BUTTON_LABEL_TEXT>Required if using a quick-reply button. Button label text. Maximum 25 characters. Alphanumeric characters only.Unsubscribe
<TEMPLATE_LANGUAGE> StringRequired. Template language code.en_US
<TEMPLATE_NAME> StringRequired. Template name. Must be unique, unless existing templates with the same name have a different template language. Maximum 512 characters. Lowercase, alphanumeric characters and underscores only.reservation_confirmation
<URL_BUTTON_URL> StringRequired if including a URL button. URL to be loaded in WhatsApp user's default web browser when tapped.https://www.luckyshrubeater.com/reservations
<URL_BUTTON_LABEL_TEXT> StringRequired if using a URL button. Button label text. Maximum 25 characters. Alphanumeric characters only.View deals
<WHATSAPP_BUSINESS_ACCOUNT_ID> StringRequired. WhatsApp Business account ID.546151681022936

Response syntax

Upon success:

{  
  "id": "<TEMPLATE_ID>",  
  "status": "<TEMPLATE_STATUS>",  
  "category": "<TEMPLATE_CATEGORY>"  
}

Response parameters

PlaceholderDescriptionExample value
<TEMPLATE_CATEGORY>Template category.MARKETING
<TEMPLATE_ID>Template ID.1627019861106475
<TEMPLATE_STATUS>Template status.PENDING

Example request

curl 'https://graph.facebook.com/v23.0/102290129340398/message_templates' \  
-H 'Content-Type: application/json' \  
-H 'Authorization: Bearer EAAJB...' \  
-d '  
{  
  "name": "welcome_discount_template",  
  "language": "en_US",  
  "category": "marketing",  
  "parameter_format": "named",  
  "components": [  
    {  
      "type": "header",  
      "format": "image",  
      "example": {  
        "header_handle": [  
          "4::aW..."  
        ]  
      }  
    },  
    {  
      "type": "body",  
      "text": "Welcome to Lucky Shrub, {​{first_name}​}!\n\nUse code *{​{discount_code}​}* to get {​{discount_amount}​} off of your first purchase!",  
      "example": {  
        "body_text_named_params": [  
          {  
            "param_name": "first_name",  
            "example": "Pablo"  
          },  
          {  
            "param_name": "discount_code",  
            "example": "WELCOME20"  
          },  
          {  
            "param_name": "discount_amount",  
            "example": "20%"  
          }  
        ]  
      }  
    },  
    {  
      "type": "footer",  
      "text": "Lucky Shrub: Your gateway to succulents!"  
    },  
    {  
      "type": "buttons",  
      "buttons": [  
        {  
          "type": "url",  
          "text": "View deals",  
          "url": "https://www.luckyshrub.com/deals"  
        },  
        {  
          "type": "phone_number",  
          "text": "Call us",  
          "phone_number": "+15550051310"  
        },  
        {  
          "type": "quick_reply",  
          "text": "Unsubscribe"  
        }  
      ]  
    }  
  ]  
}'

Example response

{  
  "id": "1627019861106475",  
  "status": "PENDING",  
  "category": "MARKETING"  
}

Step 2: Send a custom marketing template

Use the Messages API to send an approved marketing template.

Request syntax

This example syntax is for sending the template described in the create syntax above, which expects a header image asset, and 3 body text parameter values which will replace their parameter placeholders in the body text string.

curl 'https://graph.facebook.com/<API_VERSION>/<BUSINESS_PHONE_NUMBER_ID>/messages' \  
-H 'Content-Type: application/json' \  
-H 'Authorization: Bearer <ACCESS_TOKEN>' \  
-d '  
{  
  "messaging_product": "whatsapp",  
  "recipient_type": "individual",  
  "to": "<WHATSAPP_USER_PHONE_NUMBER>",  
  "type": "template",  
  "template": {  
    "name": "<TEMPLATE_NAME>",  
    "language": {  
      "code": "<TEMPLATE_LANGUAGE>"  
    },  
    "components": [  
      {  
        "type": "header",  
        "parameters": [  
          {  
            "type": "image",  
            "image": {  
              "id": "<HEADER_ASSET_ID>"  
            }  
          }  
        ]  
      },  
      {  
        "type": "body",  
        "parameters": [  
          {  
            "type": "text",  
            "parameter_name": "<PARAMETER_NAME>",  
            "text": "<PARAMETER_VALUE>"  
          },  
          <!-- additional parameters and values go here -->  
        ]  
      }  
    ]  
  }  
}'

Request parameters

PlaceholderDescriptionExample value
<ACCESS_TOKEN> StringRequired. Access token.EAAAN6tcBzAUBOZC82CW7iR2LiaZBwUHS4Y7FDtQxRUPy1PHZClDGZBZCgWdrTisgMjpFKiZAi1FBBQNO2IqZBAzdZAA16lmUs0XgRcCf6z1LLxQCgLXDEpg80d41UZBt1FKJZCqJFcTYXJvSMeHLvOdZwFyZBrV9ZPHZASSqxDZBUZASyFdzjiy2A1sippEsF4DVV5W2IlkOSr2LrMLuYoNMYBy8xQczzOKDOMccqHEZD
<API_VERSION> StringOptional. API version. If omitted, defaults to the newest API version available to your app.v23.0
<BUSINESS_PHONE_NUMBER_ID> StringRequired. WhatsApp Business phone number ID.106540352242922
<HEADER_ASSET_ID> StringRequired if template uses a header media. Header media asset ID.1339522734477770
<PARAMETER_NAME> StringRequired if template uses one or more named parameters. Name of named parameter.discount_code
<PARAMETER_VALUE> StringRequired if template uses one or more named parameters. Named parameter value.WELCOME25
<TEMPLATE_LANGUAGE> StringRequired. Template language.en_US
<TEMPLATE_NAME> StringRequired. Template name.welcome_discount_template
<WHATSAPP_USER_PHONE_NUMBER> StringRequired. WhatsApp user phone number.16505551234

Response syntax

Upon success:

{  
  "messaging_product": "whatsapp",  
  "contacts": [  
    {  
      "input": "<WHATSAPP_USER_PHONE_NUMBER>",  
      "wa_id": "<WHATSAPP_USER_ID>"  
    }  
  ],  
  "messages": [  
    {  
      "id": "<WHATSAPP_MESSAGE_ID>",  
      "message_status": "<PACING_STATUS>"  
    }  
  ]  
}

Response parameters

PlaceholderDescriptionExample value
<PACING_STATUS>Template pacing status.accepted
<WHATSAPP_MESSAGE_ID>WhatsApp Message ID. This ID is included in status messages webhooks for delivery status purposes.wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBJBRkJENzExMTRFRjk2NTI1OTEA
<WHATSAPP_USER_ID>WhatsApp user's WhatsApp ID. May not match input value.16505551234
<WHATSAPP_USER_PHONE_NUMBER>WhatsApp user's WhatsApp phone number. May not match wa_id value.16505551234

Example request

curl 'https://graph.facebook.com/v23.0/106540352242922/messages' \  
-H 'Content-Type: application/json' \  
-H 'Authorization: Bearer EAAJB...' \  
-d '  
{  
  "messaging_product": "whatsapp",  
  "recipient_type": "individual",  
  "to": "16505551234",  
  "type": "template",  
  "template": {  
    "name": "welcome_discount_template",  
    "language": {  
      "code": "en_US"  
    },  
    "components": [  
      {  
        "type": "header",  
        "parameters": [  
          {  
            "type": "image",  
            "image": {  
              "id": "1339522734477770"  
            }  
          }  
        ]  
      },  
      {  
        "type": "body",  
        "parameters": [  
          {  
            "type": "text",  
            "parameter_name": "first_name",  
            "text": "Jessica"  
          },  
          {  
            "type": "text",  
            "parameter_name": "discount_code",  
            "text": "WELCOME25"  
          },  
          {  
            "type": "text",  
            "parameter_name": "discount_amount",  
            "text": "25%"  
          }  
        ]  
      }  
    ]  
  }  
}'

Example response

{  
  "messaging_product": "whatsapp",  
  "contacts": [  
    {  
      "input": "16505551234",  
      "wa_id": "16505551234"  
    }  
  ],  
  "messages": [  
    {  
      "id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBIyQjM2RTlERTY4QjFGNzUwNDgA",  
      "message_status": "accepted"  
    }  
  ]  
}

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About