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/messages

Send a template or text message. Provide templateId (+ variables) OR body, not both.

Parameters

ParameterTypeDescription
senderIdrequiredstring (UUID)An active WhatsApp sender.
torequiredstringRecipient phone number in E.164 (e.g. +61411111111).
templateIdstring (UUID)Approved template to send. Mutually exclusive with body.
variablesstring[]Values for the template’s {{1}}..{{N}} placeholders (count must match).
bodystringFree-form text. Requires an open conversation window.

Headers

ParameterTypeDescription
Idempotency-KeystringOptional. 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/messages

List 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.