Send a free-form text message
WhatsApp
POST /v1/messages/text
Send free-form text to a recipient with an open 24-hour conversation window. For sends outside that window, use a template.
POST
Send a free-form text message
Sends a free-form text message to a recipient. WhatsApp only allows free-form text inside the 24-hour window since the user’s last inbound message; if the window is closed, Meta will reject the message and the broadcast ends in
Same shape as
FAILED. For sends outside the window, use POST /v1/messages/template.
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. |
channel_id | string | Yes | ObjectId of the sending WhatsApp channel. |
text | string | Yes | Message body. Up to 4096 characters. |
meta_data | object | No | Free-form metadata persisted with the message. |
Example request
Response
202 Accepted
POST /v1/messages/template.
400 Bad Request
Invalid body (empty text, longer than 4096 characters, malformed phone number).401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have themessages:send scope.
Operational notes
- 24-hour window: Keebai does not reject the request if the window is closed — the send is attempted and, if Meta rejects it, the broadcast ends in
FAILED. Check status withGET /v1/messages/bulk/:broadcastId. - No special emoji handling: WhatsApp supports full UTF-8, including emojis. Keebai performs no extra sanitization.
- No native Markdown formatting: WhatsApp interprets
*text*as bold,_text_as italic, and~text~as strikethrough. A backslash escapes these characters.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
application/json