Skip to content

Generic Template

Updated: Apr 1, 2026

Generic Template card with an image, the title Cards to Uplift and Inspire, subtitle, and Shop Now and Help Me Choose buttons

The generic template allows you to send a structured message that includes an image, text, and buttons. A generic template with multiple templates described in the elements array will send a horizontally scrollable carousel of items, each composed of an image, text, and buttons.

Limitations

This feature is currently not available in the web version.

Request URI

https://graph.facebook.com/v25.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>

Example request

curl -X POST -H "Content-Type: application/json" -d '{  
  "recipient":{  
    "id":"<IGSID>"  
  },  
  "message":{  
    "attachment":{  
      "type":"template",  
      "payload":{  
        "template_type":"generic",  
        "elements":[  
           {  
            "title":"Welcome!",  
            "image_url":"https://github.com/fbsamples/original-coast-clothing/blob/main/public/looks/male-work.jpg",  
            "subtitle":"We have the right hat for everyone.",  
            "default_action": {  
              "type": "web_url",  
              "url": "https://www.originalcoastclothing.com",  
            },  
            "buttons":[  
              {  
                "type":"web_url",  
                "url":"https://www.originalcoastclothing.com",  
                "title":"View Website"  
              },{  
                "type":"postback",  
                "title":"Start Chatting",  
                "payload":"DEVELOPER_DEFINED_PAYLOAD"  
              }  
            ]  
          }  
        ]  
      }  
    }  
  }  
}' "https://graph.facebook.com/v10.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>"

Example response

{
  "recipient_id": "1254477777772919",
  "message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P"
}

Properties

recipient

Description of the message recipient. All requests must include one of the following properties to identify the recipient.

PropertyTypeDescription
recipient.idStringIG Scoped User ID (IGSID) of the message recipient.

message

Description of the message to be sent.

PropertyTypeDescription
message.attachmentObjectAn object describing attachments to the message.

message.attachment

PropertyTypeDescription
typeStringValue must be template
payloadObjectpayload of the template.

message.attachment.payload

PropertyTypeDescription
template_typeStringValue must be generic
elementsArray<element>An array of element objects that describe instances of the generic template to be sent. Specifying multiple elements will send a horizontally scrollable carousel of templates. A maximum of 10 elements is supported.

message.attachment.payload.elements

The generic template supports a maximum of 10 elements per message. At least one property must be set in addition to title.

Property NameTypeDescription
titleStringThe title to display in the template. 80 character limit.
subtitleStringOptional. The subtitle to display in the template. 80 character limit.
image_urlStringOptional. The URL of the image to display in the template.
default_actionObjectOptional. The default action executed when the template is tapped. Accepts the same properties as URL button, except title.
buttonsArray<button>Optional. An array of buttons to append to the template. A maximum of 3 buttons per element is supported. Only postback and web_url buttons are supported.

Learn more

Visit the message.attachment.data for GIFs and Stickers.

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