Send a WhatsApp message
このページは 日本語 ではまだ利用できません。デフォルトの言語 (English) で表示しています。
Send a WhatsApp message
https://api.cekat.ai/messages/whatsappSends a free-form WhatsApp message in an existing conversation. WhatsApp only delivers these within 24 hours of the contact’s last message; outside that window, send a template with POST /templates/send.
The message is queued and the response returns right away with status: sent. Check delivery later with GET /messages/{message_id}.
media_type |
What to send |
|---|---|
text |
message |
image, video, document |
file_url (the type is also detected from the file extension), with message as the caption |
location |
location with latitude and longitude, plus optional name and address |
button |
message and action.buttons: 1 to 3 buttons, each {"type": "reply", "reply": {"id", "title"}}; titles up to 20 characters |
list |
message and action with button (up to 20 characters) and sections: up to 10 sections, each with a title (up to 24 characters) and up to 10 rows of {"id", "title", "description"} |
cta_url |
message and action {"name": "cta_url", "parameters": {"display_text", "url"}}; display_text up to 20 characters |
header ({"text"} or {"file_url"}) and footer (text) are optional for button, list and cta_url messages.
Authorization
Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.
Body application/jsonrequired
A WhatsApp conversation.
Message text, or the caption for media.
text, image, video, document, location, button, list, cta_url"text"Public URL of the image, video or document to send.
Show child attributes
Buttons, list or link, depending on media_type.
Show child attributes
Response
Message queued for sending.
A message in a conversation. Additional fields may be present.
Show child attributes
ID of the sender (agent, AI agent, contact or system).
Who sent the message, for example user (the contact), agent, api or system.
The channel's message ID, for example the WhatsApp message ID.
Delivery status, for example sent, delivered, read or failed.
ISO 8601 UTC with version=2026-05-22 or later; otherwise YYYY-MM-DD HH:mm:ss in Asia/Jakarta time.
AI credits used to generate the message, for AI replies.
Extra data, such as the ad referral for messages that came from a click-to-WhatsApp ad.
Show child attributes
Show child attributes
The message is invalid, contains a blocked phrase, the contact is blocked, or the conversation has no WhatsApp number.
Show child attributes
The API key is missing or invalid.
Show child attributes
The conversation was not found.
Show child attributes
Rate limit exceeded. Wait and retry.
curl --request POST \
--url 'https://api.cekat.ai/messages/whatsapp' \
--header 'api_key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
const response = await fetch('https://api.cekat.ai/messages/whatsapp', {
method: 'POST',
headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.cekat.ai/messages/whatsapp"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
"conversation_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/messages/whatsapp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'conversation_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"success": true,
"status_code": 1,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"sent_by": "<string>",
"sent_by_name": "example_name",
"sent_by_type": "<string>",
"media_type": "<string>",
"media_url": "https://example.com",
"platform_mid": "<string>",
"status": "<string>",
"is_template": true,
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z",
"chat_credits_used": 10000,
"location": {},
"action": {},
"additional_data": {},
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "Jane Doe",
"phone_number": "6281234567890",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "example_name",
"type": "<string>"
},
"inbox": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Jane Doe",
"phone_number": "6281234567890",
"type": "<string>"
}
}
}
{
"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>"
}