Create a template

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

Create a template

POSThttps://api.cekat.ai/templates

Creates a WhatsApp message template on the inbox’s WhatsApp Business Account and submits it to Meta for review. The new template usually starts with status: PENDING; check GET /api/templates to see when it becomes APPROVED.

  • Template names must follow Meta’s rules: lowercase letters, numbers and underscores.
  • Use {{1}}, {{2}}, and so on for variables in body, and send one sample value per variable in body_placeholder. Meta uses the samples during review.
  • Attach an image as file to give the template an image header.
  • Meta may change the category if it does not match the content.

Authorization

api_keystringheaderrequired

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

Body multipart/form-datarequired

namestringrequired

Template name, using lowercase letters, numbers and underscores.

max length: 512
categorystringrequired
Available options: AUTHENTICATION, MARKETING, UTILITY
languagestringrequired

Meta language code. Supported codes: Afrikaans (af), Albanian (sq), Arabic (ar), Azerbaijani (az), Bengali (bn), Bulgarian (bg), Catalan (ca), Chinese (CHN: zh_CN; HKG: zh_HK; TAI: zh_TW), Croatian (hr), Czech (cs), Danish (da), Dutch (nl), English (en), English (UK: en_GB; US: en_US), Estonian (et), Filipino (fil), Finnish (fi), French (fr), Georgian (ka), German (de), Greek (el), Gujarati (gu), Hausa (ha), Hebrew (he), Hindi (hi), Hungarian (hu), Indonesian (id), Irish (ga), Italian (it), Japanese (ja), Kannada (kn), Kazakh (kk), Kinyarwanda (rw_RW), Korean (ko), Kyrgyz (Kyrgyzstan: ky_KG), Lao (lo), Latvian (lv), Lithuanian (lt), Macedonian (mk), Malay (ms), Malayalam (ml), Marathi (mr), Norwegian (nb), Persian (fa), Polish (pl), Portuguese (BR: pt_BR; POR: pt_PT), Punjabi (pa), Romanian (ro), Russian (ru), Serbian (sr), Slovak (sk), Slovenian (sl), Spanish (es), Spanish (ARG: es_AR; SPA: es_ES; MEX: es_MX), Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Thai (th), Turkish (tr), Ukrainian (uk), Urdu (ur), Uzbek (uz), Vietnamese (vi), and Zulu (zu).

bodystringrequired

Message text. Use {{1}}, {{2}}, and so on for variables.

max length: 1024
inbox_idstring<uuid>required

ID of a connected WhatsApp inbox.

body_placeholderstring

JSON array of sample values, one per body variable, in order. Required when body contains variables.

filestring<binary>

Optional header image (JPEG or PNG).

Response

201
400
401
404
429

Template created and submitted to Meta.

successboolean
status_codeinteger
dataTemplate[]
Show child attributes
idstring<uuid>

Cekat's internal template ID.

created_atstring

Creation time. See Versioning for the format.

wa_template_idstring

Meta's template ID. Use this value to send, delete, or run a campaign with the template.

namestring
categorystring
Available options: AUTHENTICATION, MARKETING, UTILITY
languagestring
statusstring

Meta review status, for example APPROVED, PENDING, or REJECTED. Only APPROVED templates can be sent.

bodystring
body_placeholderstring[] | null

Sample values for the body variables, as submitted to Meta.

header_typestring | null
Available options: TEXT, DOCUMENT, IMAGE, VIDEO
file_urlstring | null

URL of the header media, for templates with a media header.

buttonsobject[] | null
inbox_idstring<uuid>
business_idstring<uuid>
inboxTemplateInbox
Show child attributes
idstring<uuid>
namestring
typestring
statusstring
business_idstring<uuid>

A field is missing or invalid, the inbox is not a WhatsApp inbox, or Meta rejected the template. error.message explains why.

successboolean
status_codeinteger
errorobject
Show child attributes
messagestring

The API key is missing or invalid.

successboolean
status_codeinteger
errorobject
Show child attributes
messagestring

The inbox was not found.

successboolean
status_codeinteger
errorobject
Show child attributes
messagestring

Rate limit exceeded. Wait and retry.

messagestring
POST/templates
cURL
JavaScript
Python
PHP
curl --request POST \
  --url 'https://api.cekat.ai/templates' \
  --header 'api_key: YOUR_API_KEY' \
  --form 'name=Jane Doe' \
  --form 'category=AUTHENTICATION' \
  --form 'language=<string>' \
  --form 'body=<string>' \
  --form 'inbox_id=3c90c3cc-0d44-4b50-8888-8dd25736052a'
const form = new FormData();
form.append('name', "Jane Doe");
form.append('category', "AUTHENTICATION");
form.append('language', "<string>");
form.append('body', "<string>");
form.append('inbox_id', "3c90c3cc-0d44-4b50-8888-8dd25736052a");

const response = await fetch('https://api.cekat.ai/templates', {
  method: 'POST',
  headers: { 'api_key': 'YOUR_API_KEY' },
  body: form
});

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

url = "https://api.cekat.ai/templates"
headers = {"api_key": "YOUR_API_KEY"}
data = {
    "name": "Jane Doe",
    "category": "AUTHENTICATION",
    "language": "<string>",
    "body": "<string>",
    "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

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

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.cekat.ai/templates',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY'],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
201
400
401
404
429
{
  "success": true,
  "status_code": 1,
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created_at": "2026-01-15T09:30:00Z",
      "wa_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "Jane Doe",
      "category": "AUTHENTICATION",
      "language": "<string>",
      "status": "<string>",
      "body": "<string>",
      "body_placeholder": [
        "<string>"
      ],
      "header_type": "TEXT",
      "header": "<string>",
      "file_url": "https://example.com",
      "footer": "<string>",
      "buttons": [
        {}
      ],
      "inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "inbox": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "Jane Doe",
        "type": "<string>",
        "status": "<string>",
        "business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    }
  ]
}
{
  "success": true,
  "status_code": 1,
  "error": {
    "message": "<string>"
  }
}
{
  "success": true,
  "status_code": 1,
  "error": {
    "message": "<string>"
  }
}
{
  "success": true,
  "status_code": 1,
  "error": {
    "message": "<string>"
  }
}
{
  "message": "<string>"
}