Skip to main content
The generic template renders a card (or a horizontally scrollable carousel of up to 10 cards) with an image, title, subtitle, and buttons. Buttons are web_url or postback; a postback tap returns as an inbound postback webhook.

Request

curl -X POST "${INSTAGRAM_GRAPH_API_URL}/${INSTAGRAM_USER_ID}/messages" \
  -H "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "recipient": {
    "id": "17841400000000001"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "generic",
        "elements": [
          {
            "title": "Blue Tee",
            "image_url": "https://example.com/tee.jpg",
            "subtitle": "$24.00",
            "buttons": [
              {
                "type": "web_url",
                "url": "https://example.com/tee",
                "title": "View"
              },
              {
                "type": "postback",
                "title": "Buy",
                "payload": "BUY_TEE"
              }
            ]
          }
        ]
      }
    }
  }
}'