Send a message
Send a message to a recipient via SMS or WhatsApp.
Channel selection:
- If channel is omitted and messageType is text, defaults to SMS
- If messageType is anything other than text, WhatsApp is used automatically
WhatsApp 24-hour window:
- Free-form messages (non-template) require an open 24h window
- Window opens when the user messages you first
- Use template messages to initiate conversations outside the window
Plan allowances and email billing:
- WhatsApp, Telegram, Instagram and Messenger share an allowance of 2,000 messages per month on Free. Over it, sends return 429 with code a2p_limit_exceeded and upgrade details; the counter resets on the 1st of each month. Paid plans have no message caps
- Email is billed from your prepaid balance in 1,000-message blocks: $0.40 per 1,000 transactional emails, $0.80 per 1,000 marketing (broadcast) emails. A block is charged when your monthly count crosses each 1,000 boundary, and at zero balance email sends return 402 with code insufficient_balance. Free teams start with $2 of credit and additionally cap at 3,000 emails/month and 100/day. Teams on earlier plans keep their original email quotas instead
- SMS and voice are billed per message from your balance on every plan
Email recipient pre-flight: Email messages are validated automatically before dispatch. Sends that would be a guaranteed hard bounce are failed instead of sent, protecting your bounce rate: the message transitions to failed (visible via GET /v1/messages/{messageId} and the message.failed webhook) with errorCode set to EMAIL_INVALID_RECIPIENT (malformed address), EMAIL_DOMAIN_NOT_FOUND (recipient domain has no MX or A records), or EMAIL_RECIPIENT_SUPPRESSED (address is on your suppression list after a previous bounce or complaint). Advisory signals (role addresses, disposable domains) do not block sends — check them beforehand with POST /v1/introspect/email.
Headers
Optional sender profile ID. If omitted, the project's default sender will be used.
Request body
Example request
{
"to": "+56912345678",
"text": "Your verification code is 123456.",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"footerText": "Dates subject to change.",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"subject": "Your order confirmation",
"replyTo": "support@example.com",
"idempotencyKey": "msg_01HZY4ZP7VQY2J3BRW7Z6G0QGE",
"voiceLanguage": "es-ES",
"attachments": [
{
"filename": "invoice.pdf",
"content_type": "application/pdf",
"content_id": "logo"
}
]
}Response
Message accepted for delivery.
Example response
{
"message": {
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"from": "+13125551212",
"senderId": "sender_12345",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"footerText": "Dates subject to change.",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"conversationId": "js723987cyghwqxxaxcf590qd18axd95"
}
}