Sending Carousel Messages

POST /api/external/messages/carousel

Auth: Authorization: Bearer ck_<api_key> (required)

Request parameters

FieldRequiredTypeDescription
phoneNumberIdYesstringWhatsApp phone number ID to send from. Alias: Phone_Number_Id.
toYesstringRecipient phone with country code
templateNameYesstringApproved carousel template name
templateIdNonumberInternal template ID. Must match templateName if provided.
languageCodeNostringTemplate language (default en_US)
bodyParamsNoarrayTemplate body variable values. Each item: { "type": "text", "text": "..." }
cardsYesarray2–10 card objects (see below)

cards[] item fields

FieldRequiredTypeDescription
card_indexYesnumberZero-based sequential index (0, 1, …)
headerMediaIdYes*stringMeta media ID for card header. *Omitted for catalog-auto-image cards.
headerMediaTypeNostringimage or video (default image)
bodyParamsNoarrayPer-card body variable values
buttonsNoarrayUp to 2 buttons per card (see below)

cards[].buttons[] item fields

FieldRequiredTypeDescription
sub_typeYesstringquick_reply, url, or phone_number
indexYesstringButton index matching the approved template
parametersNoarrayButton parameters. Quick reply: { "type": "payload", "payload": "..." }. URL: { "type": "text", "text": "..." }.

Response example

{
  "success": true,
  "messageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjAwMDAwMDAwMDAwMDAwAA==",
  "data": {
    "metaMessageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjAwMDAwMDAwMDAwMDAwAA==",
    "dbMessageId": 9001,
    "conversationId": 1001
  }
}

Error responses

Literal codes and messages returned by POST /messages/carousel:

HTTPcodeerror / errors
403TEMPLATE_NOT_APPROVEDTemplate is not approved. Only APPROVED carousel templates can be sent.
400VALIDATION_ERRORerrors array with validation messages
404PHONE_NOT_FOUNDPhone number ID not found in this account.
404TEMPLATE_NOT_FOUNDTemplate not found in this account.
502META_ERRORerror — Meta API error message

Code samples

curl -X POST https://chatyug.com/api/external/messages/carousel \
  -H "Authorization: Bearer ck_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumberId": "100000000000001",
    "to": "919876543210",
    "templateName": "summer_sale_carousel",
    "templateId": 501,
    "languageCode": "en_US",
    "bodyParams": [{ "type": "text", "text": "Rahul" }],
    "cards": [
      {
        "card_index": 0,
        "headerMediaId": "media_800000000000001",
        "buttons": [
          {
            "sub_type": "quick_reply",
            "index": "0",
            "parameters": [{ "type": "payload", "payload": "yes" }]
          }
        ]
      },
      {
        "card_index": 1,
        "headerMediaId": "media_800000000000002",
        "buttons": [
          {
            "sub_type": "url",
            "index": "0",
            "parameters": [{ "type": "text", "text": "https://example.com/sale" }]
          }
        ]
      }
    ]
  }'
const axios = require('axios');

await axios.post('https://chatyug.com/api/external/messages/carousel', {
  phoneNumberId: '100000000000001',
  to: '919876543210',
  templateName: 'summer_sale_carousel',
  templateId: 501,
  languageCode: 'en_US',
  bodyParams: [{ type: 'text', text: 'Rahul' }],
  cards: [
    {
      card_index: 0,
      headerMediaId: 'media_800000000000001',
      buttons: [{ sub_type: 'quick_reply', index: '0', parameters: [{ type: 'payload', payload: 'yes' }] }]
    },
    {
      card_index: 1,
      headerMediaId: 'media_800000000000002',
      buttons: [{ sub_type: 'url', index: '0', parameters: [{ type: 'text', text: 'https://example.com/sale' }] }]
    }
  ]
}, { headers: { Authorization: 'Bearer ck_your_api_key_here' } });
import requests

requests.post('https://chatyug.com/api/external/messages/carousel', json={
    'phoneNumberId': '100000000000001',
    'to': '919876543210',
    'templateName': 'summer_sale_carousel',
    'templateId': 501,
    'languageCode': 'en_US',
    'bodyParams': [{'type': 'text', 'text': 'Rahul'}],
    'cards': [
        {
            'card_index': 0,
            'headerMediaId': 'media_800000000000001',
            'buttons': [{'sub_type': 'quick_reply', 'index': '0', 'parameters': [{'type': 'payload', 'payload': 'yes'}]}]
        },
        {
            'card_index': 1,
            'headerMediaId': 'media_800000000000002',
            'buttons': [{'sub_type': 'url', 'index': '0', 'parameters': [{'type': 'text', 'text': 'https://example.com/sale'}]}]
        }
    ]
}, headers={'Authorization': 'Bearer ck_your_api_key_here'})
$client = new GuzzleHttp\Client();
$client->post('https://chatyug.com/api/external/messages/carousel', [
    'headers' => ['Authorization' => 'Bearer ck_your_api_key_here'],
    'json' => [
        'phoneNumberId' => '100000000000001',
        'to' => '919876543210',
        'templateName' => 'summer_sale_carousel',
        'templateId' => 501,
        'languageCode' => 'en_US',
        'bodyParams' => [['type' => 'text', 'text' => 'Rahul']],
        'cards' => [
            [
                'card_index' => 0,
                'headerMediaId' => 'media_800000000000001',
                'buttons' => [['sub_type' => 'quick_reply', 'index' => '0', 'parameters' => [['type' => 'payload', 'payload' => 'yes']]]]
            ],
            [
                'card_index' => 1,
                'headerMediaId' => 'media_800000000000002',
                'buttons' => [['sub_type' => 'url', 'index' => '0', 'parameters' => [['type' => 'text', 'text' => 'https://example.com/sale']]]]
            ]
        ]
    ]
]);
Related webhooks: Delivery updates for each card send are forwarded as eventType: status. Commerce carousel Buy taps create orders with order_source: carousel_campaign; text inquiries use carousel_inquiry. Retrieve them via GET /orders.