Create a campaign

Halaman ini belum tersedia dalam Bahasa Indonesia. Menampilkan bahasa default (English).

Create a campaign

POSThttps://api.cekat.ai/api/campaigns

Sends an approved template to every contact in a recipient list, now or at a scheduled time. Messages go out in batches of 20.

The campaign is created with status: processing (sending now) or status: scheduled. Track it with GET /api/campaigns and GET /api/v2/campaigns/{id}/messages. Carousel templates are not supported.

Authorization

api_keystringheaderrequired

Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.

Authorizationstringheader

Alternative to api_key: send the same key as Bearer YOUR_API_KEY.

Body application/jsonrequired

campaign_namestringrequired
inbox_idstring<uuid>required

The WhatsApp inbox that sends the campaign. It must own the template.

recipient_list_idstring<uuid>required

ID from POST /api/recipients or GET /api/recipients.

template_idstringrequired

The template's wa_template_id.

template_body_variablesstring[]

One value per body variable, in order. The count must match the template's highest variable number, and values cannot be empty.
Use name or phone_number to insert each recipient's own name or number.

schedule_atstring<date-time>

When to start sending, as an ISO 8601 date-time in the future (for example 2026-10-20T09:00:00+07:00). Leave out to send immediately.

label_idstring<uuid>

Optional label added to each recipient's conversation. Follow-ups set up for this label in the inbox also run.

Response

201
400
401
422
429
503

Campaign created and queued.

successboolean
dataobject
Show child attributes
idstring<uuid>

Campaign ID.

campaign_namestring
statusstring
Available options: processing, scheduled
created_atstring<date-time>

The request is invalid.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

The API key is missing or invalid.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

A required field is missing, the inbox, template or recipient list was not found, the inbox is not WhatsApp, the variables don't match the template, or schedule_at is invalid or in the past.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

Rate limit exceeded. Wait and retry.

messagestring

The campaign was saved but could not be queued, and has been marked failed. Create it again.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

POST/api/campaigns
cURL
JavaScript
Python
PHP
curl --request POST \
  --url 'https://api.cekat.ai/api/campaigns' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "campaign_name": "example_name",
  "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "recipient_list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
const response = await fetch('https://api.cekat.ai/api/campaigns', {
  method: 'POST',
  headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "campaign_name": "example_name",
    "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "recipient_list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  })
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.cekat.ai/api/campaigns"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
    "campaign_name": "example_name",
    "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "recipient_list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.cekat.ai/api/campaigns',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'campaign_name' => 'example_name',
    'inbox_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'recipient_list_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
  ]),
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
201
400
401
422
429
503
{
  "success": true,
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "campaign_name": "example_name",
    "status": "processing",
    "created_at": "2026-01-15T09:30:00Z"
  }
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "message": "<string>"
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}