Skip to main content
POST
/
v1
/
messages
curl --request POST \
  --url https://api.zavu.dev/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "to": "+56912345678",
  "text": "Your verification code is 123456"
}
'
{
"message": {
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"channel": "auto",
"messageType": "text",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"from": "+13125551212",
"senderId": "sender_12345",
"text": "<string>",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mediaId": "<string>",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"latitude": 123,
"longitude": 123,
"locationName": "<string>",
"locationAddress": "<string>",
"contacts": [
{
"name": "<string>",
"phones": [
"<string>"
]
}
],
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"listButton": "<string>",
"sections": [
{
"title": "<string>",
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
]
}
],
"emoji": "<string>",
"reactToMessageId": "<string>",
"templateId": "<string>",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
}
},
"providerMessageId": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"cost": 123,
"costProvider": 123,
"costTotal": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Zavu-Sender
string

Optional sender profile ID. If omitted, the project's default sender will be used.

Example:

"sender_12345"

Body

application/json

Request body to send a message.

to
string
required

Recipient phone number in E.164 format or email address.

Example:

"+56912345678"

channel
enum<string>
default:auto

Delivery channel. Use 'auto' for intelligent routing. If omitted with non-text messageType, WhatsApp is used. For email recipients, defaults to 'email'.

Available options:
auto,
sms,
whatsapp,
telegram,
email,
instagram,
voice
messageType
enum<string>
default:text

Type of message. Defaults to 'text'.

Available options:
text,
image,
video,
audio,
document,
sticker,
location,
contact,
buttons,
list,
reaction,
template
text
string

Text body for text messages or caption for media messages.

Example:

"Your verification code is 123456."

content
object

Additional content for non-text message types.

subject
string

Email subject line. Required when channel is 'email' or recipient is an email address.

Maximum string length: 998
Example:

"Your order confirmation"

htmlBody
string

HTML body for email messages. If provided, email will be sent as multipart with both text and HTML.

replyTo
string<email>

Reply-To email address for email messages.

Example:

"support@example.com"

idempotencyKey
string

Optional idempotency key to avoid duplicate sends.

Example:

"msg_01HZY4ZP7VQY2J3BRW7Z6G0QGE"

metadata
object

Arbitrary metadata to associate with the message.

fallbackEnabled
boolean
default:true

Whether to enable automatic fallback to SMS if WhatsApp fails. Defaults to true.

Response

Message accepted for delivery.

message
object
required