Send a template
Halaman ini belum tersedia dalam Bahasa Indonesia. Menampilkan bahasa default (English).
Send a template
https://api.cekat.ai/templates/sendSends 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.
Authorization
Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.
Body application/jsonrequired
The template's wa_template_id. The template must be APPROVED.
The WhatsApp inbox that owns the template and sends the message.
Recipient's number, digits only with country code.
Contact name to save if the contact is new. Defaults to the phone number.
One value per body variable, in order ({{1}}, {{2}}, ...). The count must match the template. Send [] for templates without variables.
One-time code, for AUTHENTICATION templates only.
15Header 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.
Response
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.
Show child attributes
Message ID.
The text that was sent, with variables filled in.
sent, failedWhy the message failed, when status is failed.
WhatsApp message ID returned by Meta.
The template's wa_template_id.
ID of the agent the message is sent as.
Billing details for the message.
A required field is missing, the template is not approved, the variable count does not match, or the message contains a blocked phrase.
Show child attributes
The API key is missing or invalid.
Show child attributes
The inbox or template was not found.
Show child attributes
Rate limit exceeded. Wait and retry.
curl --request POST \
--url 'https://api.cekat.ai/templates/send' \
--header 'api_key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wa_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "6281234567890"
}'
const response = await fetch('https://api.cekat.ai/templates/send', {
method: 'POST',
headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"wa_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "6281234567890"
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.cekat.ai/templates/send"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
"wa_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "6281234567890"
}
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/templates/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'wa_template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'inbox_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phone_number' => '6281234567890'
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"success": true,
"status_code": 1,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "sent",
"error": "<string>",
"platform_mid": "<string>",
"media_type": "<string>",
"media_url": "https://example.com",
"is_template": true,
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_category": "<string>",
"sent_by": "<string>",
"sent_by_name": "example_name",
"sent_by_type": "<string>",
"additional_data": {},
"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>"
}