/v1/messagesSend a message
Send one message on one or more channels.
channels is a list of channels, in order. Each entry is complete on its own: it has the channel, the sender profile, the recipient and the content.
With one entry, we send on that channel only.
With more entries, we send on the first channel. We try the next channel only if the previous one did not deliver. There is no failover switch: the number of entries decides it. Failover below explains when a channel counts as not delivered, and how failover_after changes that.
The request is all-or-nothing. If any entry is not valid or cannot be sent, we reject the whole request and send nothing.
Each channel entry names its sender profile in profile_id: the UUID we gave you for one of your profiles. The profile gives the sender address, and your reports show the message under it. Every channel needs one.
WhatsApp is different. A WhatsApp entry has no profile_id. It names one of your connected WhatsApp numbers in profile_number_id, and that number's profile is the sender. A message that starts a conversation is always one of your approved templates, by name and language. Within 24 hours of the recipient's last message to that number you may also send text, media, a location, contacts, a reaction or an interactive message.
An sms entry may send one of your approved SMS templates instead of free text: SMS templates below.
SMS templates
An sms entry carries either content or template, never both - not even a shared top-level content. template.id is the template's UUID from the portal, and template.params a flat object of strings, one per #{token} in the template's text:
{
"channels": [
{
"channel": "sms",
"profile_id": "b3d9e7a1-...",
"to": "385991234567",
"template": {
"id": "7c1e9a52-4b0d-4f3e-9a61-2d8f5c0b3e17",
"params": {
"customer_name": "Ana",
"order_number": "#1042"
}
}
}
]
}
#{token} in the template's text is replaced by params.<token>. An empty or missing value takes the variable's fallback; with no fallback it is a 400. Values the text does not use are ignored. The finished text is then sent as if you had sent it as content.
A template that is not yours or not on the entry's profile_id is 404 TEMPLATE_NOT_FOUND; one that is not approved is 403 TEMPLATE_NOT_ACTIVE. A value that does not fit its variable is a 400 VALIDATION_FAILED, with an entry in errors on channels[n].template.params.<token> (or on channels[n].template for contains_contact) and a code in errors[].error: is_required, too_long, bad_format, contains_link, contains_phone, contains_email, host_not_allowed, not_allowed or contains_contact.
Marketing templates. A template marked Marketing in the portal always goes out with an unsubscribe link, and you cannot turn it off; one marked Transactional, and free text, never do. The link counts toward the message's length and parts, and its label is in the language of the number's country (English when we have none for it). It unsubscribes the number from the template's brand.
If the number already unsubscribed from the template's brand - through this API or any of its campaigns - the request is refused with 422 RECIPIENT_OPTED_OUT, and nothing is sent or charged. Transactional templates and free text are not checked, so order notifications still reach it. If the link cannot be added right now, the message is not sent without it: 503 OPT_OUT_LINK_UNAVAILABLE with a retry-after header, and nothing is charged.
Template-only keys. An API key may be set to send templates only (keys made for a shop connector are). Free content from such a key, on any entry, is a 403 TEMPLATES_ONLY and nothing is sent. An sms entry with neither content nor template is a 400 on content, as on any key.
Failover
When a request lists more than one channel, we send on the first. We move on to the next channel only when the current one did not deliver. That is when:
- the channel refuses the message when we send it;
- the channel reports it as not delivered (
UNDELIVERABLE); - the entry has
failover_after, and the channel has not reportedDELIVEREDwithin that many seconds.
Only a DELIVERED report stops failover: we do not try the channels after it. A SEEN report on its own does not. If a channel cannot take the message, it moves to the next entry, or ends with a final delivery report when there is none. Treat a message with no final report after the 3 days we keep it as not delivered.
failover_after is a whole number of seconds, at least 1. The time starts when we hand the message to the channel. It is optional, also when there is a next entry. Without it, we wait for the channel's own report. If the channel never reports, we do not move on. We keep a message for 3 days, so a failover_after longer than that never moves on either.
On the last entry there is no next channel. If you set failover_after there and the time is up without a DELIVERED, the message ends as UNDELIVERABLE with error 5000, and a later delivery is not reported to you. Leave it out on the last entry to wait for the real outcome.
SMS can only be the last channel in channels. failover_after does not apply to it.
You get one final delivery report per message: DELIVERED from the channel that delivered it, or UNDELIVERABLE from the last channel tried. Its channel says which. Channels we moved on from send you nothing else, but you may still get a SEEN from one of them if the recipient reads the message there later. Its channel says which.
Reading the response
A 202 means we accepted the message and will try to deliver it. It does not mean the message has arrived. You get back a request_id. Keep it: the delivery report uses it, and so do we in any support request.
Every error has the same shape, application/problem+json. It has a code your code can check and a title to put in your logs:
{
"title": "Not enough balance to send",
"status": 402,
"code": "OUT_OF_BALANCE"
}
The HTTP status tells you the kind of problem, so you can handle most errors without reading code. A 4xx is something to fix in the request or on your account. Only 429, 500 and 503 are worth retrying unchanged. 401 always means your API key was not accepted, and nothing else.
Rate limit
Each API key may send the number of requests per second agreed for it (20 unless agreed otherwise), counted across our whole platform. A key that has been quiet may use a full second's allowance at once. After that, we accept requests at an even pace. Every authenticated response tells you where you stand:
RateLimit-Limit- your requests per second.RateLimit-Remaining- how many more you can send right now.RateLimit-Reset- seconds until the full allowance is back.
Over the limit you get a 429 with Retry-After (seconds) and retry_after_ms in the body: the exact wait until we accept your next request. Nothing was sent, so you can repeat the same request as it is. What you send within the limit is queued for delivery with no cap, and it does not expire.
Delivery reports and replies
Each API key has one webhook: the URL you gave us when we set up the key. A send may name another URL in callback_url; that message's delivery reports go there instead, and replies still go to the key's webhook. We POST two kinds of call, and type tells them apart:
"type": "DLR"- a delivery report for a message you sent, aDeliveryReport."type": "MO"- a message a recipient sent back to you, aReplyCallback.
Without a webhook you get no replies, and delivery reports only for sends that carry a callback_url. The deliveryReport and reply callbacks below show both payloads, with an example of each kind.
Rules for both kinds
If a webhook secret is set for your API key, every call carries it in the
X-Webhook-Secretheader. Reject a call without it. Compare the whole value: it is the same on every call. Ask us if you need it in a header with another name.Answer with any
2xxto confirm the call. For anything else, or when we cannot connect, we retry with a growing delay for up to two days, then stop. That also covers a secret change: while you deploy the new secret, rejected calls are retried, not lost.We send these calls at a limited rate per API key, which we set for you (20 a second unless agreed otherwise). During a large campaign they may arrive spread out, not all at once.
A call can arrive more than once. Treat a repeat of the same
message_idandtype(and, for a delivery report,status) as already handled.
Delivery reports (DLR)
message_id is the request_id you got from the send. status is DELIVERED, SEEN or UNDELIVERABLE; DELIVERED and UNDELIVERABLE are final, SEEN is extra. error is 000 when delivered and otherwise says why not, from the table on DeliveryReport. channel is the channel the report is about, and cost and count are what it charged. Failover above explains which reports a message with several channels sends.
Replies (MO)
message_id is our id of the reply, from the recipient who wrote, and reply_to_message_id the request_id of your message they answered, when there is one. Replies can arrive out of order, so order them by received_at.
WhatsApp -
contentis the reply, as aReplyContent: text, a tapped template button, a picked button or list reply, a reaction added or removed, a location, contacts, or media (image, video, audio or voice, document, sticker). A media reply carries our copy of the file inurl, orurlnullwitherrorwhen there is no file to give you. Other kinds of message are not sent to you.Viber -
contentis alwaysnull; it is used only on WhatsApp. Read these fields instead:Field What it holds textWhat the user wrote. For a tapped button, the button's label. media_urlThe link to a file the user sent (an image, video or document). Then there is no text.conversation_idThe Viber chat the reply belongs to. It is the same for every reply in that chat, so you can group them.
Request body
application/jsontostringOptional default recipient for every entry that has no
toof its own. Checked astoon the entry.Example:
"447123456789"contentany ofOptional default content for every entry that has no
contentof its own, checked against each entry's channel as its owncontentwould be. Not allowed on a request with ansmsentry that sends atemplate.callback_urlstringOptional. Where to POST this message's delivery reports, in place of the webhook set for your API key. Must be a public
http(s)URL; anything else is a400oncallback_url. Replies are not affected: they always go to the key's webhook. The key's webhook secret is sent with these calls too.Example:
"https://example.com/bind/delivery-reports"link_shorteningobjectReplace the links in the text with short links on your brand's domain, as in campaigns, so clicks are counted. A link is an
http(s)://orwww.address; punctuation right after it is not part of it. If shortening fails, the message goes out with its original links. Every link is shortened unless a rule inexcludekeeps it as written; a rule inincludebrings part of an excluded range back. A rule is a domain -bind.hr, which also covershelp.bind.hr- or the start of a link with a path -bind.hr/web-summit-lisbon, which covers that page, its subpages and query strings, but notbind.hr/web-summit-lisbon-2027; a trailing/makes no difference. A rule ending in?,=,&or#matches any link that starts with it. When several rules match, the longest decides; the same rule in both lists keeps the link. Case,https://andwww.are ignored. Links already on one of our short domains, and links no longer than a short link, are always left as written. An entry may carry at most 20 links to shorten; more is a400onchannels[n].content. Shortening applies to the text (sms, andviber'stext), not to WhatsApp.channelsarray of objectsrequired· min 1 items· max 20 itemsThe channels to send on, in order. At least one. Each entry carries everything that channel needs. An
smsentry must be the last one; anywhere else it is a400onchannels[n].channeland nothing is sent.
Responses
Ready to send your first message?
We set up your account, sender profiles and API key with you, and help you through the first integration.

