Your webhook URLA recipient's reply
A ReplyCallback, "type": "MO", POSTed to the webhook set for your API key when a recipient writes back on a channel that carries replies. Your webhook also gets delivery reports ("type": "DLR", the deliveryReport callback), so check type first. Without a webhook you get no replies. Each reply is its own call with its own message_id. It is not a delivery report and never changes one.
The rules are the same for both kinds of call:
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.
Replies are sent in the order we receive them, but that is not a promise: order them by received_at, the time the recipient's channel reports. A media reply in particular can reach you after a reply the recipient sent later.
profile_id is the sender profile that received the reply. On WhatsApp it is the profile of the number the recipient wrote to, and profile_number_id is that number: the profile_number_id you send with.
reply_to_message_id is the request_id of the message you sent that the reply refers to (a quoted message, a tapped quick reply, a reaction), taken from our delivery cache. It is null when the reply does not reference an earlier message, when the referenced message is older than the delivery cache window, or when the recipient quoted their own message. It is never the channel's own message id.
WhatsApp - what each recipient action sends you:
| Recipient action | Callbacks, in order |
|---|---|
| Receives your message | DLR DELIVERED, then DLR SEEN when read receipts are on |
| Writes text | MO, content.type text |
| Quotes your message in a reply | MO, content.type text, reply_to_message_id set |
| Taps a quick-reply button of your template | MO, content.type button, reply_to_message_id set |
| Picks a button reply | MO, content.type interactive, content.interactive.type button_reply, reply_to_message_id set when WhatsApp names the message |
| Picks a list reply | MO, content.type interactive, content.interactive.type list_reply, reply_to_message_id set when WhatsApp names the message |
| Reacts with an emoji | MO, content.type reaction with emoji, reply_to_message_id set |
| Removes a reaction | MO, content.type reaction without emoji, reply_to_message_id set |
| Shares a location | MO, content.type location |
| Shares contacts | MO, content.type contacts |
| Sends media (an image, video, document, audio or sticker), with or without a caption | MO, content.type image, video, document, audio or sticker; the file's url is our copy of it, or null with error media_unavailable |
| Sends a file WhatsApp does not pass on to us (for example one over 100 MB) | MO, content.type document, its url null with error media_unavailable, and no mime_type, sha256, file name or caption |
Any other kind of reply (an order, a completed flow, a system message, an empty message) is not sent to you.
Viber - content is always null; it is used only on WhatsApp. Read these fields instead:
| Field | What it holds |
|---|---|
text |
What the user wrote. For a tapped button, the button's label. |
media_url |
The link to a file the user sent (an image, video or document). Then there is no text. |
conversation_id |
The Viber chat the reply belongs to. It is the same for every reply in that chat, so you can group them. |
Payload
application/jsontypestringrequiredValues:MOchannelstringrequiredThe channel the reply came in on.
Values:whatsappvibermessage_idstring (uuid)requiredOur id of this reply. Use it to recognise a repeated callback.
profile_idstring (uuid)requirednullableThe sender profile that received the reply.
nullwhen the profile has no id for the API. On WhatsApp it is the profile of the number the recipient wrote to.profile_number_idstring (uuid)The connected WhatsApp number the recipient wrote to - the
profile_number_idyou send with. WhatsApp only.fromstringrequirednullableThe recipient who replied, as a phone number in international format without
+.tostringrequiredThe address the reply was sent to - on WhatsApp your number in international format without
+, on Viber the sender name.received_atstring (date-time)requirednullableWhen the recipient's channel received the reply. Order replies by it.
reply_to_message_idstring (uuid)requirednullableThe
request_idof the message you sent that this reply refers to, from our delivery cache.nullwhen it does not reference an earlier message, when that message is older than the delivery cache window, or when the recipient quoted their own message.client_idstring (uuid)WhatsApp, for a partner whose clients send with its number: the id of your client whose message the recipient quoted - the same message as
reply_to_message_id. Absent on every other reply; an unquoted reply on your number is yours to route.contentany ofrequiredThe reply itself, a
ReplyContentbytype.nullon Viber.textstringViber: the reply itself - what the user wrote, or the label of a tapped button. Absent on a file reply.
WhatsApp: read
contentinstead;textis kept for older integrations. It holds the text of a text reply, the label of a tapped button, the title of a picked button or list reply, the caption of a media reply, or the emoji of a reaction, and is absent for every other reply (a removed reaction, a location, contacts, media without a caption).conversation_idstringViber only - the Viber chat the reply belongs to. It is the same for every reply in that chat, so you can group them.
media_urlstringViber only - the link to a file the user sent (an image, video or document). Absent on every other reply.
Your answer
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.

