Skip to content

Quoted Replies

Reply to a specific WhatsApp message so it appears quoted above your answer. Set content.replyToMessageId to the ID of the message you are answering.

View .md

A quoted reply shows the message you are answering above your own, the way a person does it in WhatsApp with a swipe. Use it when a conversation has several open questions and the contact needs to see which one you are answering.

Send a Quoted Reply

Set content.replyToMessageId to the Zavu ID of the message you are answering. For a message the contact sent you, that is the data.messageId of its message.inbound webhook.

const result = await zavu.messages.send({ to: "+14155551234", channel: "whatsapp", text: "Your order ships tomorrow.", content: { replyToMessageId: "msg_abc123", }, });

The quote works on every WhatsApp message type except reaction, which already names the message it reacts to. An image, a document or a button message can quote too: add replyToMessageId next to the rest of its content.

You can quote messages in both directions: one the contact sent you, or one you sent them. Either way it must belong to the conversation you are sending to, and the sender you send from must be the one that sent or received it.

Replying from a Webhook

TypeScript
app.post("/webhooks/zavu", async (req, res) => { const event = req.body; if (event.type === "message.inbound" && event.data.channel === "whatsapp") { await zavu.messages.send({ to: event.data.from, channel: "whatsapp", text: await answer(event.data.text), content: { replyToMessageId: event.data.messageId }, // Answer from the sender that received the message. "Zavu-Sender": event.senderId, }); } res.sendStatus(200); });

What Comes Back

The stored message carries the full reply context, so GET /v1/messages/{messageId} shows what was quoted:

JSON
{ "content": { "replyToMessageId": "msg_abc123", "replyToProviderMessageId": "wamid.HBgL...ORIGINAL", "replyToFrom": "+14155551234", "replyToText": "When does my order ship?", "replyToMessageType": "text" } }

Only replyToMessageId is read from your request. The other replyTo* fields are filled in by Zavu.

Errors

A quote that cannot be delivered as a quote is refused. Zavu never sends it unquoted.

StatusCauseFix
404The message is not in this project, or the ID is malformedUse the messageId from the webhook or from GET /v1/messages
400The send is not going out on WhatsApp or TelegramSet channel explicitly. With auto, a phone number can route to SMS
400The quoted message went out on another channelSend on the channel of the quoted message
400The quoted message belongs to another conversation than toQuote a message exchanged with this recipient
400The quoted message was sent or received by another senderPass that sender in the Zavu-Sender header
400The quoted message failedQuote a message that was delivered or received
400The quoted message has no provider ID yet, because it is still queuedWait until it is sent
400messageType is reactionRemove replyToMessageId

Quoted replies also work on Telegram.