WhatsApp reply context: what the Hub supports

Contextual replies on the CRPRO Hub: the send endpoint has no context field. Meta payload for reference, reading context on inbound taps, and a workaround.

A contextual reply is a message that quotes an earlier one: the small preview above the bubble that shows what is being answered. In busy conversations it removes ambiguity, so developers often ask for it first. The honest answer for the CRPRO Hub is that the send endpoint does not accept it today. This article shows the Meta payload, labelled as such, explains what the Hub does instead and gives a working way to get the same clarity without the quote bubble.

Does the CRPRO Hub support contextual replies?

Short answer: no. The Hub's message schema has no context field, and because it is strict, a body that contains one is refused with 400 INVALID_MESSAGE.

The accepted top-level fields are to, type and the object named after the type. A context object is not among them. This is not a bug to work around with a different key; the field simply is not part of the Hub's send contract. If you depend on quoted replies, plan for that gap, and do not assume it will be added. For what the Hub does accept, see the message reference in the sources and the quickstart.

# Hub request that would be refused today curl -X POST https://crprohub.com/api/v1/channels/CHANNEL_UUID/messages \ -H "Authorization: Bearer hub_pk_EXAMPLE_NOT_REAL" \ -H "Idempotency-Key: reply-attempt-1" \ -H "Content-Type: application/json" \ -d '{ "to": "5521999999999", "context": { "message_id": "wamid.X" }, "type": "text", "text": { "body": "Yes, that works." } }' # -> 400 INVALID_MESSAGE (unknown field: context)

What does the Meta payload look like?

Short answer: it is a normal message with an extra context object holding the wamid of the message being quoted. The example below is Meta's Cloud API format, shown for reference, and cannot be sent through the Hub.

Meta Cloud API payload, not accepted by the Hub: the Hub's send endpoint has no context field.
{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_PHONE_NUMBER>", "context": { "message_id": "WAMID_TO_REPLY_TO" }, "type": "text", "text": { "body": "..." } }

According to Meta's contextual replies page, message_id is the WhatsApp message id of the earlier message. The same shape applies to other message types. The page lists situations where the quote bubble may not appear: the original message was deleted or moved to long-term storage (typically after 30 days unless local storage is enabled), the reply is an audio, image or video message and the user is on KaiOS, or the reply is a template message. A reaction cannot be sent as a contextual reply either.

Can the context of received messages still be read?

Short answer: yes. When a customer taps a button or picks a list row, Meta's inbound message carries a context object whose id is the message that contained the choice. That object is in the raw message the Hub delivers.

Meta's reply buttons reference shows it: the inbound interactive message includes context.from and context.id, where context.id references the original interactive message. The Hub's message.received event includes the raw Meta message inside data.message, next to the normalized fields, as described in the webhooks reference. That makes it possible to know which of your messages a button tap answers, even when several menus are open in the same chat.

function answeredMessageId(event) { // data.message is the raw Meta message object return event.data.message?.context?.id ?? null } const asked = answeredMessageId(event) if (asked && (await store.wasSentByUs(asked))) { // route the tap to the flow that produced that exact message }

Not every inbound message has a context. A plain text typed from scratch has none, so always treat the field as optional.

How can a reply be made unambiguous without the quote bubble?

Short answer: repeat the key of what you are answering in the text, and track which question is pending on your side.

Two techniques cover most situations. The first is to restate the subject in the reply itself, for example 'About order 1042: it ships tomorrow.' That costs a few words and works on every client. The second is to keep the pending question in your database, keyed by conversation, so that a short answer such as yes is resolved against the last question you asked, not guessed. For menus, rely on the button and list ids instead of titles, because the id is the contract and the context.id tells you which menu the tap came from.

// Keep a map of what each outbound message asked await store.saveOutbound({ wamid: response.data.message_id, // returned by the Hub on send conversationId, question: 'confirm_delivery_slot', createdAt: Date.now(), }) // When a reply arrives const ctxId = event.data.message?.context?.id const pending = ctxId ? await store.findByWamid(ctxId) : await store.latestPendingQuestion(conversationId)

Does this change how idempotency keys are used?

Short answer: no. Each reply is a normal send and needs its own Idempotency-Key, ideally derived from the inbound message it answers.

Using something like reply-{inbound_message_id} means a retried webhook delivery cannot create a second answer. That is the same pattern used for text, described in the text message tutorial of this series. Remember that the 202 only says the message was accepted; the outcome arrives as a status event.

How should a project plan around the missing feature?

Short answer: design the conversation so it does not require quoting, and revisit the decision when the Hub's documentation changes.

  • Keep each question short and self-contained, with a subject word in the first line.
  • Use reply buttons and lists for choices; they carry ids and a context on the way back.
  • Store the wamid of every outbound message you may need to correlate.
  • Re-read the message reference before relying on this behaviour in a new project.

A cheap way to confirm how inbound context behaves for your channel is to send yourself a reply-button message from a test number, tap a button and inspect the event that arrives at your endpoint. The webhook test endpoint and the deliveries list, both covered in the webhooks reference, make it easy to see the exact body before writing any parsing code. Do that once, save the sample as a fixture, and your correlation logic can be tested without a phone in the loop.

If quoting is a hard requirement for your product, that is worth knowing before you build rather than after. Check the documentation for the current state of the platform before committing to a design.

How can the correlation approach be tested end to end?

Short answer: send a button message from a test channel, tap it on a test phone, capture the event and replay it through the handler.

The sequence exercises every part of the workaround: your store of outbound ids, the inbound context and the routing logic. Start with a menu that has two buttons and a different action behind each. Tap the first, check that the handler resolves the message that carried the button, and then tap the second button of an older menu after sending a newer one. The second tap is the interesting one: it proves that the context id, and not simply the latest message, decides which flow receives the answer.

Write the captured events into your test fixtures and keep them under version control. When the platform adds fields or your handler changes, the same fixtures protect you from regressions, and they document the real shape of the data better than any prose description.

  • Store the wamid of each outbound message with its purpose.
  • Capture a real event and save it as a fixture.
  • Test a tap on an old menu after a newer one has been sent.
  • Test a plain typed message with no context at all.
  • Assert that unknown ids are ignored without errors.

Frequently asked questions

Why does the Hub refuse a body with a context field?

Its message schema is strict and defines only the fields of each message type. context is not one of them, so the request fails validation with 400 INVALID_MESSAGE.

Where does the message id to quote come from?

In Meta's format it is the wamid of the earlier message. Through the Hub you can get it from data.message_id of a message.received event or from the message_id returned when you sent a message.

Is the context object present on every inbound message?

No. Meta includes it on replies to a specific message, such as button and list replies. A message typed from scratch has no context, so read it defensively.

Can a reaction act as a contextual reply?

No. Meta's reference says a reaction message cannot be sent as a contextual reply. A reaction is attached to a message through its own message_id field.

Fontes

Documentação oficial da Meta, conferida em 31 de outubro de 2026.