# POST /messages — Send Carousel template

> Product: **Pabbly Chatflow** (v1)
> Base URL: `https://chatflow.pabbly.com/api/v1`
> Auth: Bearer via `Authorization` header
> Canonical: `/chatflow/messages/send-carousel-template`

Prerequisites: You need to create a carousel template through Pabbly Chatflow or WhatsApp Manager. Carousel templates allow you to send a horizontally scrollable set of cards (2–10), each containing a media header (image or video), body text with optional variables, and up to 2 interactive buttons. Hit the API with the POST method and fill the following data according to your requirements to send a carousel template message.

**Body parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| to | integer | Yes | Recipient number with dialing code |
| type | string | Yes | Type of message you want to send. It should be "template" in case you want to send a carousel template message |
| templateName | string | Yes | Name of the approved carousel template you want to send |
| languageCode | string | No | Language code of the template (e.g., "en", "hi"). Defaults to the template's language if omitted |
| bodyParams | array | No | Values for variables in the main body text (outside the carousel cards). e.g., ["John"] for {{1}} or {{name}} |
| carouselBodies | array | Yes | Array of objects, one per card. Each object contains variable values for that card's body text |
| carouselFileData | array | Yes | Array of objects, one per card. Each object contains the media file URL for that card's header |
| urlVariables | array | No | Dynamic URL button parameter values, one per card. Only required if cards have dynamic URL buttons |
| copyCodeParam | string | No | Code to send with the template, if cards include a copy code button |
| quickReplies | string | No | List of quick reply payload values, if cards include quick reply buttons |
| contact | string | No | An object containing contact details. This field is used to upsert the contact matched with recipient number |

**Example request body:**

```json
{
    "to": 1123456789,
    "type": "template",
    "templateName": "carousel_testing_1",
    "languageCode": "en",
    "bodyParams": ["John"],
    "carouselBodies": [
        {
            "bodyParams": ["50", "Electronics"]
        },
        {
            "bodyParams": ["30", "Clothing"]
        },
        {
            "bodyParams": ["40", "Home Decor"]
        }
    ],
    "carouselFileData": [
        {
            "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
            "fileName": "card1.jpg"
        },
        {
            "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
            "fileName": "card2.jpg"
        },
        {
            "fileUrl": "https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
            "fileName": "card3.jpg"
        }
    ],
    "urlVariables": ["electronics", "clothing", "home-decor"]
}
```

**Response (200)** — Send Carousel template:

```json
{
    "status": "success",
    "message": "Message sent",
    "data": {
        "to": "1123456789",
        "chatId": "67762380b9e6371dXXXXXXXX",
        "metaResponse": {
            "messaging_product": "whatsapp",
            "contacts": [
                {
                    "input": "1123456789",
                    "wa_id": "1123456789"
                }
            ],
            "messages": [
                {
                    "id": "wamid.HBgMOTE3Njk3ODYyMTE1FQIAERgSQTQwMTBFQkEwNDJDXXXXXXXXXX==",
                    "message_status": "accepted"
                }
            ],
            "status": 200
        }
    }
}
```

**Code examples:**

_cURL_

```curl
curl -X POST https://chatflow.pabbly.com/api/v1/messages \
  -H "Authorization: Bearer {{YOUR_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "to": 1123456789,
    "type": "template",
    "templateName": "carousel_testing_1",
    "languageCode": "en",
    "bodyParams": [
      "John"
    ],
    "carouselBodies": [
      {
        "bodyParams": [
          "50",
          "Electronics"
        ]
      },
      {
        "bodyParams": [
          "30",
          "Clothing"
        ]
      },
      {
        "bodyParams": [
          "40",
          "Home Decor"
        ]
      }
    ],
    "carouselFileData": [
      {
        "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card1.jpg"
      },
      {
        "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card2.jpg"
      },
      {
        "fileUrl": "https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card3.jpg"
      }
    ],
    "urlVariables": [
      "electronics",
      "clothing",
      "home-decor"
    ]
  }'
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://chatflow.pabbly.com/api/v1/messages')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer {{YOUR_API_KEY}}'
request['Content-Type'] = 'application/json'
request.body = "{\"to\":1123456789,\"type\":\"template\",\"templateName\":\"carousel_testing_1\",\"languageCode\":\"en\",\"bodyParams\":[\"John\"],\"carouselBodies\":[{\"bodyParams\":[\"50\",\"Electronics\"]},{\"bodyParams\":[\"30\",\"Clothing\"]},{\"bodyParams\":[\"40\",\"Home Decor\"]}],\"carouselFileData\":[{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card1.jpg\"},{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card2.jpg\"},{\"fileUrl\":\"https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card3.jpg\"}],\"urlVariables\":[\"electronics\",\"clothing\",\"home-decor\"]}"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests

response = requests.post(
    'https://chatflow.pabbly.com/api/v1/messages',
    headers={'Authorization': 'Bearer {{YOUR_API_KEY}}'},
    json={
    'to': 1123456789,
    'type': 'template',
    'templateName': 'carousel_testing_1',
    'languageCode': 'en',
    'bodyParams': [
        'John'
    ],
    'carouselBodies': [
        {
            'bodyParams': [
                '50',
                'Electronics'
            ]
        },
        {
            'bodyParams': [
                '30',
                'Clothing'
            ]
        },
        {
            'bodyParams': [
                '40',
                'Home Decor'
            ]
        }
    ],
    'carouselFileData': [
        {
            'fileUrl': 'https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
            'fileName': 'card1.jpg'
        },
        {
            'fileUrl': 'https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
            'fileName': 'card2.jpg'
        },
        {
            'fileUrl': 'https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
            'fileName': 'card3.jpg'
        }
    ],
    'urlVariables': [
        'electronics',
        'clothing',
        'home-decor'
    ]
},
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://chatflow.pabbly.com/api/v1/messages');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer {{YOUR_API_KEY}}', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"to":1123456789,"type":"template","templateName":"carousel_testing_1","languageCode":"en","bodyParams":["John"],"carouselBodies":[{"bodyParams":["50","Electronics"]},{"bodyParams":["30","Clothing"]},{"bodyParams":["40","Home Decor"]}],"carouselFileData":[{"fileUrl":"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D","fileName":"card1.jpg"},{"fileUrl":"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D","fileName":"card2.jpg"},{"fileUrl":"https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D","fileName":"card3.jpg"}],"urlVariables":["electronics","clothing","home-decor"]}');

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://chatflow.pabbly.com/api/v1/messages"))
    .header("Authorization", "Bearer {{YOUR_API_KEY}}")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"to\":1123456789,\"type\":\"template\",\"templateName\":\"carousel_testing_1\",\"languageCode\":\"en\",\"bodyParams\":[\"John\"],\"carouselBodies\":[{\"bodyParams\":[\"50\",\"Electronics\"]},{\"bodyParams\":[\"30\",\"Clothing\"]},{\"bodyParams\":[\"40\",\"Home Decor\"]}],\"carouselFileData\":[{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card1.jpg\"},{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card2.jpg\"},{\"fileUrl\":\"https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card3.jpg\"}],\"urlVariables\":[\"electronics\",\"clothing\",\"home-decor\"]}"));

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const response = await fetch('https://chatflow.pabbly.com/api/v1/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer {{YOUR_API_KEY}}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "to": 1123456789,
    "type": "template",
    "templateName": "carousel_testing_1",
    "languageCode": "en",
    "bodyParams": [
      "John"
    ],
    "carouselBodies": [
      {
        "bodyParams": [
          "50",
          "Electronics"
        ]
      },
      {
        "bodyParams": [
          "30",
          "Clothing"
        ]
      },
      {
        "bodyParams": [
          "40",
          "Home Decor"
        ]
      }
    ],
    "carouselFileData": [
      {
        "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card1.jpg"
      },
      {
        "fileUrl": "https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card2.jpg"
      },
      {
        "fileUrl": "https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
        "fileName": "card3.jpg"
      }
    ],
    "urlVariables": [
      "electronics",
      "clothing",
      "home-decor"
    ]
  }),
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    payload := strings.NewReader("{\"to\":1123456789,\"type\":\"template\",\"templateName\":\"carousel_testing_1\",\"languageCode\":\"en\",\"bodyParams\":[\"John\"],\"carouselBodies\":[{\"bodyParams\":[\"50\",\"Electronics\"]},{\"bodyParams\":[\"30\",\"Clothing\"]},{\"bodyParams\":[\"40\",\"Home Decor\"]}],\"carouselFileData\":[{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card1.jpg\"},{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card2.jpg\"},{\"fileUrl\":\"https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card3.jpg\"}],\"urlVariables\":[\"electronics\",\"clothing\",\"home-decor\"]}")
    req, _ := http.NewRequest("POST", "https://chatflow.pabbly.com/api/v1/messages", payload)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer {{YOUR_API_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://chatflow.pabbly.com/api/v1/messages");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer {{YOUR_API_KEY}}");
request.Content = new StringContent("{\"to\":1123456789,\"type\":\"template\",\"templateName\":\"carousel_testing_1\",\"languageCode\":\"en\",\"bodyParams\":[\"John\"],\"carouselBodies\":[{\"bodyParams\":[\"50\",\"Electronics\"]},{\"bodyParams\":[\"30\",\"Clothing\"]},{\"bodyParams\":[\"40\",\"Home Decor\"]}],\"carouselFileData\":[{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card1.jpg\"},{\"fileUrl\":\"https://plus.unsplash.com/premium_photo-1749666992791-53362d6dc507?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card2.jpg\"},{\"fileUrl\":\"https://images.unsplash.com/photo-1772223610205-0a8f53d83b42?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\"fileName\":\"card3.jpg\"}],\"urlVariables\":[\"electronics\",\"clothing\",\"home-decor\"]}");
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

---

**Other endpoints in Messages:**

- [POST /messages — Send Text template](/chatflow/messages/send-text-template)
- [POST /messages — Send Media based template](/chatflow/messages/send-media-based-template)
- [POST /messages — Send Authentication template](/chatflow/messages/send-authentication-template)
- [POST /messages — Send CTA/Buttons template](/chatflow/messages/send-cta-buttons-template)
- [POST /messages — Send LTO template](/chatflow/messages/send-lto-template)
- [POST /messages — Send Text Message](/chatflow/messages/send-text-message)
- [POST /messages — Send Image Message](/chatflow/messages/send-image-message)
- [POST /messages — Send Audio Message](/chatflow/messages/send-audio-message)
- [POST /messages — Send Video Message](/chatflow/messages/send-video-message)
- [POST /messages — Send Document Message](/chatflow/messages/send-document-message)
- [POST /messages — Send Single Product Message](/chatflow/messages/send-single-product-message)
- [POST /messages — Send Multi Product Message](/chatflow/messages/send-multi-product-message)
- [POST /messages — Send Catalog Message](/chatflow/messages/send-catalog-message)
- [POST /messages — Send List Message](/chatflow/messages/send-list-message)
- [POST /messages — Send CTA URL Message](/chatflow/messages/send-cta-url-message)
- [POST /messages — Send Address Request Message](/chatflow/messages/send-address-request-message)
- [POST /messages — Send Location Request Message](/chatflow/messages/send-location-request-message)

