API Create Broadcast Carousel
이 페이지는 아직 한국어 언어로 제공되지 않습니다. 기본 언어(English)로 표시합니다.
API Create Broadcast Carousel
POST {BASE_URL}/api/campaigns
Create a broadcast campaign that sends an approved WhatsApp carousel template to every recipient in a recipient list, the same as creating one from the dashboard. This is the same endpoint as API Create Broadcast Campaign, with one added parameter, carousel_cards, that carries the content of each card. The message body can still be personalised per recipient from the recipient list, while every card is identical for every recipient. A successful request returns the campaign id, campaign_name, status, and created_at, and the campaign is immediately visible on the dashboard under Broadcast Settings > Campaign.
Create Broadcast Carousel Method
| HTTP Method | Endpoint | Description |
|---|---|---|
| POST | {BASE_URL}/api/campaigns |
Create a broadcast campaign with a carousel template |
Create Broadcast Carousel Request
Request Headers
Content-Type: application/json
authorization: api_key {{YOUR_API_KEY}}
Sample Request
This example uses a carousel template with 2 cards. The second card has no file_url, so it is sent with the media approved on the template.
{
"campaign_name": "November Promo",
"inbox_id": "a1b2c3d4-0000-1111-2222-333344445555",
"recipient_list_id": "f6e5d4c3-9999-8888-7777-666655554444",
"template_id": "1002478156150000",
"label_id": "22334455-6677-8899-aabb-ccddeeff0011",
"schedule_at": "2026-11-10T10:00:00+07:00",
"template_body_variables": ["name"],
"carousel_cards": [
{
"file_url": "https://files.cekat.ai/promo-sepatu.jpg",
"body_variables": ["Sepatu Lari", "299.000"],
"url_button_tails": ["sepatu-lari"]
},
{
"body_variables": ["Tas Ransel", "199.000"],
"url_button_tails": ["tas-ransel"]
}
]
}
| JSON Attribute | Description | Type | Required |
|---|---|---|---|
campaign_name |
Name of the campaign. | String | Required |
inbox_id |
ID of the sender inbox. Only WhatsApp inboxes are supported. Use GET /api/inboxes to retrieve valid IDs. |
String | Required |
recipient_list_id |
ID of the recipient list to send to. Raw phone numbers are not accepted directly; recipients must come from a recipient list. Use GET /api/recipients to retrieve valid IDs. |
String | Required |
template_id |
ID of the approved carousel template to send. Use GET /api/templates to retrieve valid IDs. The template must have the APPROVED status. |
String | Required |
label_id |
ID of the conversation label applied to every conversation this campaign generates. Use GET /api/labels to retrieve valid IDs. |
String | Optional |
schedule_at |
Scheduled send time, ISO 8601. If omitted, the campaign sends immediately. Cannot be a past datetime. | String (datetime) | Optional |
template_body_variables |
Ordered array of values for the variables in the message body of the template ({{1}}, {{2}}, …). Entries resolve per recipient exactly as in API Create Broadcast Campaign. Required only if the message body has variables. |
Array of String | Conditional |
carousel_cards |
Ordered array with one entry per card of the template. See Resolving carousel_cards in the Notes section below below. Required only if at least one card has values to fill. |
Array of Object | Conditional |
Resolving carousel_cards
Each entry fills one card of the approved template. Entries map to cards by position: entry 0 is the first card of the template, entry 1 is the second, and so on. The array length must equal the card count of the template.
| Field | Description | Type | Required |
|---|---|---|---|
file_url |
URL of the media for this card, as served by Cekat after the file is uploaded. Replaces the media approved on the template for this card only. The media must match the template header format, image or video. | String | Optional |
body_variables |
Ordered array of values for the placeholders in the body of this card. | Array of String | Conditional |
url_button_tails |
Ordered array of values appended to the base URL of this card’s Visit Website buttons, in the template button order. | Array of String | Conditional |
No field inside a card is required by the schema. Each one is required only where the approved template has something for it to fill, and is rejected where it does not.
| Field | Required when | Omit when |
|---|---|---|
body_variables |
The body of that card contains placeholders. | The body of that card contains none. |
url_button_tails |
That card has a Visit Website button whose base URL ends with a variable. | That card has no Visit Website button, or its URL is fixed. |
file_url |
Never. | The card is sent with the media approved on the template. |
carousel_cards itself is required only when at least one card needs body_variables or url_button_tails. A carousel template with no card variables and no URL variables can be sent without carousel_cards, and every card is delivered exactly as approved. Because entries map to cards by position, a card that needs nothing is sent as an empty object {} whenever a later card needs values.
Where each value comes from
| Value | Source |
|---|---|
Message body variables (template_body_variables) |
The recipient list column when the entry matches a column header, otherwise the entry is sent as-is to every recipient. |
Card body variables (body_variables) |
Always sent as-is, the same for every recipient. |
Card media (file_url) |
Always the same file for every recipient. |
URL tails (url_button_tails) |
Always sent as-is, the same for every recipient. |
Only the message body is personalised per recipient. Everything on a card is identical for every recipient in the campaign. A card value that matches a recipient list column header is still sent exactly as written, and is never replaced with the recipient’s value.
Media requirements
| Media | Requirements |
|---|---|
| Image | JPEG or PNG, 8-bit RGB or RGBA, up to 5 MB. |
| Video | MP4 or 3GPP, up to 16 MB, H.264 video and AAC audio, with a single audio stream or none. |
Text limits
| Field | Limit |
|---|---|
| Card body, after variables are replaced | 160 characters |
| Message body, after variables are replaced | 1,024 characters |
| Resolved URL of a Visit Website button | 2,000 characters |
cURL Example
curl --location '{BASE_URL}/api/campaigns' \
--header 'Content-Type: application/json' \
--header 'authorization: api_key {{YOUR_API_KEY}}' \
--data '{
"campaign_name": "November Promo",
"inbox_id": "a1b2c3d4-0000-1111-2222-333344445555",
"recipient_list_id": "f6e5d4c3-9999-8888-7777-666655554444",
"template_id": "1002478156150000",
"schedule_at": "2026-11-10T10:00:00+07:00",
"template_body_variables": ["name"],
"carousel_cards": [
{
"file_url": "https://files.cekat.ai/promo-sepatu.jpg",
"body_variables": ["Sepatu Lari", "299.000"],
"url_button_tails": ["sepatu-lari"]
},
{
"body_variables": ["Tas Ransel", "199.000"],
"url_button_tails": ["tas-ransel"]
}
]
}'
Create Broadcast Carousel Response
Success Response (201)
{
"id": "d1e2f3a4-0000-1111-2222-333344445555",
"campaign_name": "November Promo",
"status": "scheduled",
"created_at": "2026-11-09T10:04:00+07:00"
}
| JSON Attribute | Description | Type |
|---|---|---|
id |
Campaign ID generated by Cekat. | String |
campaign_name |
Campaign name, as submitted. | String |
status |
processing if the campaign sends immediately, scheduled if schedule_at was provided. |
String |
created_at |
Campaign creation timestamp. | String (datetime) |
Error Responses
| Status Code | When it happens |
|---|---|
| 401 | Missing or invalid API key |
| 422 | A required field is missing, inbox_id / recipient_list_id / template_id is invalid, schedule_at is in the past, template_body_variables does not match the message body, or carousel_cards fails validation (see below) |
| 503 | Campaign failed to queue |
Carousel validation errors (422)
Validation runs when the campaign is created. If any check fails, nothing is queued and no message is sent.
| When it happens | Message |
|---|---|
The length of carousel_cards differs from the card count of the template |
Carousel card count does not match. Template has 5 cards, received 3. |
The template has card values to fill and carousel_cards is omitted |
carousel_cards is required because this template has card values to fill. |
carousel_cards is sent for a template that is not a carousel |
carousel_cards is only valid for carousel templates. |
A card has body placeholders and body_variables is omitted |
Names the position of the card. |
A card has no body placeholders and body_variables is sent |
Card has no body variables, so body_variables must be omitted, with the position of the card. |
The number of body_variables differs from the number of placeholders in that card |
Names the position of the card and both counts. |
A card has a Visit Website button ending in a variable and url_button_tails is omitted |
Card requires url_button_tails for its URL button, with the position of the card. |
A card has no URL variable and url_button_tails is sent |
Names the position of the card. |
file_url is a video on an image template, or an image on a video template |
Card media must be image, matching the template header format. or the video equivalent. |
| A card body exceeds 160 characters after variables are replaced, or a URL exceeds 2,000 characters | Names the field that overflowed. |
Sample 422: card count mismatch
{
"success": false,
"message": "Carousel card count does not match. Template has 5 cards, received 3."
}
Notes
- Card order is fixed when the template is created and cannot be changed in the request. Entries in
carousel_cardsmap to cards by position, so entry 0 is always the first card of the template. Rearranging the array does not reorder the cards, it only puts each set of values on the wrong card. - Button order within a card is fixed in the same way.
url_button_tailsmaps to the Visit Website buttons of the card in the template button order. - Quick Reply and Call Phone Number buttons accept no values. Their label, payload, and phone number are fixed on the template.
- Card media is uploaded to Meta when the campaign runs, not when it is created, so a scheduled campaign picks up the file at send time. Each distinct file is uploaded once and reused for every recipient. If a
file_urlcannot be downloaded or uploaded, the campaign fails with a reason and no partial message is sent. - If a recipient’s value for a column referenced in
template_body_variablesis empty, or the message body becomes longer than 1,024 characters for that recipient, only that recipient fails and the rest of the campaign still sends. The failure and its reason are visible per recipient onGET /api/v2/campaigns/:id/messages. label_id,schedule_at, recipient identifiers (phone number first, BSUID as fallback), campaign listing, and per-recipient delivery status work the same as for any other campaign.- This is an optional addition to the existing endpoint. Every existing request stays valid and behaves as before, so there is no new API version.
- Not supported: different card content per recipient, quick reply values at send time, per-card button labels, base URLs, or phone numbers, changing the number or order of cards, and editing or cancelling a carousel campaign after it is created.
{BASE_URL}is a placeholder. Confirm the production host with engineering before use.