Send a template
Sends an approved WhatsApp template to one phone number. Cekat creates the contact and conversation if they don't exist yet.
Check success in the body, not only the HTTP status. If Meta rejects the message (for example, an invalid number or insufficient balance), the endpoint still returns HTTP 200, with success: false, status_code: 400, data.status: failed, and the reason in data.error.
Your business's Cekat API key, from Settings → Developers & API in the Cekat dashboard (https://chat.cekat.ai/developers?section=apikeys). Available on the Business and Enterprise plans.
The template's wa_template_id. The template must be APPROVED.
1234567890123456The WhatsApp inbox that owns the template and sends the message.
Recipient's number, digits only with country code.
6281234567890Contact name to save if the contact is new. Defaults to the phone number.
Jane DoeOne value per body variable, in order ({{1}}, {{2}}, ...). The count must match the template. Send [] for templates without variables.
["Jane","10"]One-time code, for AUTHENTICATION templates only.
Header media URL to use instead of the template's default, for templates with a media header.
Optional agent ID. The conversation is assigned to this agent after sending.
The message was processed. Check success to see whether it was sent.
False when Meta rejected the message.
200 when sent, 400 when the message failed.
A required field is missing, the template is not approved, the variable count does not match, or the message contains a blocked phrase.
The API key is missing or invalid.
The inbox or template was not found.
Rate limit exceeded. Wait and retry.
POST /templates/send HTTP/1.1
Host: api.cekat.ai
api_key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 182
{
"wa_template_id": "1234567890123456",
"inbox_id": "0f9e8d7c-6b5a-4c3d-2e1f-0a9b8c7d6e5f",
"phone_number": "6281234567890",
"phone_name": "Jane Doe",
"template_body_variables": [
"Jane",
"10"
]
}{
"success": true,
"status_code": 200,
"data": {
"id": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"message": "Halo Jane, ada diskon 10% untuk Anda bulan ini!",
"conversation_id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",
"status": "sent",
"error": null,
"platform_mid": "wamid.HBgNNjI4MTIzNDU2Nzg5MBUCABEYEjQ5",
"media_type": "image",
"media_url": "https://cdn.example.com/promo.png",
"is_template": true,
"template_id": "1234567890123456",
"template_category": "marketing",
"sent_by": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"sent_by_name": "Admin Toko",
"sent_by_type": "api",
"additional_data": {
"billing_mode": "credit_card",
"is_balance_locked": false,
"estimated_price": 0,
"currency_code": "IDR"
},
"business_id": "2f7431e4-cd89-4daf-a40d-a5d779b3dd1e"
}
}Last updated