For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

post
Authorizations
api_keystringRequired

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.

Body
wa_template_idstringRequired

The template's wa_template_id. The template must be APPROVED.

Example: 1234567890123456
inbox_idstring · uuidRequired

The WhatsApp inbox that owns the template and sends the message.

phone_numberstringRequired

Recipient's number, digits only with country code.

Example: 6281234567890
phone_namestringOptional

Contact name to save if the contact is new. Defaults to the phone number.

Example: Jane Doe
template_body_variablesstring[]Optional

One value per body variable, in order ({{1}}, {{2}}, ...). The count must match the template. Send [] for templates without variables.

Example: ["Jane","10"]
otp_codestring · max: 15Optional

One-time code, for AUTHENTICATION templates only.

file_urlstring · uriOptional

Header media URL to use instead of the template's default, for templates with a media header.

assign_agent_idstring · uuidOptional

Optional agent ID. The conversation is assigned to this agent after sending.

Responses
200

The message was processed. Check success to see whether it was sent.

application/json
successbooleanOptional

False when Meta rejected the message.

status_codeintegerOptional

200 when sent, 400 when the message failed.

post/templates/send
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