WhatsApp Messages
Send WhatsApp messages from an active sender. A template send can start a conversation at any time; a free-form text send is only allowed inside an open 24-hour customer-service window (which opens when the customer messages you).
Send Message
POST
/v1/whatsapp/messagesSend a template or text message. Provide templateId (+ variables) OR body, not both.
Parameters
| Parameter | Type | Description |
|---|---|---|
senderIdrequired | string (UUID) | An active WhatsApp sender. |
torequired | string | Recipient phone number in E.164 (e.g. +61411111111). |
templateId | string (UUID) | Approved template to send. Mutually exclusive with body. |
variables | string[] | Values for the template’s {{1}}..{{N}} placeholders (count must match). |
body | string | Free-form text. Requires an open conversation window. |
Headers
| Parameter | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional. A repeat send with the same key returns the original message instead of sending again. |
Example Request (template)
curl -X POST https://api.txtly.com.au/v1/whatsapp/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"senderId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"to": "+61411111111",
"templateId": "a1b2c3d4-...",
"variables": ["Alice"]
}'List Messages
GET
/v1/whatsapp/messagesList recent WhatsApp messages (most recent first). Optional limit query param (default 50, max 100).
Get Message
GET
/v1/whatsapp/messages/{id}Retrieve a message with its delivery-status event timeline (sent / delivered / read / failed).
The 24-hour window
WhatsApp only allows free-form text within 24 hours of the customer's last inbound message. Outside that window you must use an approved template. A 422with "No open conversation window" means you should send a template instead.