Send an approved WhatsApp template
WhatsApp
POST /v1/messages/template
Send a Meta-approved WhatsApp template to a single recipient. Accepts named variables and returns the send id for tracking.
POST
Send an approved WhatsApp template
Queues delivery of a Meta-approved template to a single recipient. Useful for transactional notifications, reminders, and 1-to-1 messages triggered from your backend.
Under the hood, Keebai creates a broadcast with a single recipient, which lets you check its status later with
GET /v1/messages/bulk/:broadcastId.
Endpoint
Required scope
messages:send
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Content-Type | Yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number in E.164 format (e.g. +5491155555555). |
channel_id | string | Yes | ObjectId of the WhatsApp channel used to send. Get it from the portal under Channels. |
template_name | string | Yes | Template name exactly as approved in Meta. |
language | string | Yes | Template language code (es, en, pt_BR, etc.). |
variables | object<string, string> | No | Map of named variables the template expects. Keys must match the template’s {{name}} placeholders. The expected list is available via GET /v1/templates. |
meta_data | object | No | Free-form metadata persisted with the message. Useful to correlate with your system. |
Example request
Response
202 Accepted
The send was accepted and queued. Actual delivery to WhatsApp happens asynchronously.| Field | Type | Description |
|---|---|---|
broadcast_id | string | Id of the created broadcast. Use it to check status via GET /v1/messages/bulk/:broadcastId. |
status | string | Initial broadcast status: PENDING, IN_PROGRESS, COMPLETED, FAILED. |
total_recipients | number | Always 1 for this endpoint. |
scheduled_at | string | null | ISO 8601 schedule date if applicable, null for immediate delivery. |
400 Bad Request
Invalid body (incorrect phone format, malformedchannel_id, missing fields).
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have themessages:send scope.
502 Bad Gateway
Error contacting the upstream delivery service. Retry with backoff.Common patterns
Transactional notification with correlation
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
application/json
Example:
"+5491155555555"
WhatsApp Business phone_number_id (numeric identifier issued by Meta for the sending number).
Example:
"100000000000001"
Example:
"welcome_v2"
Example:
"es"
Named template variables (Meta parameter_name).
Example:
{ "nombre": "Lucio", "monto": "1500" }Free-form metadata persisted with the message. Returned on webhooks for correlation.