2-way messaging requires a connected WhatsApp Business Account (WABA). See the WhatsApp BSP guide for onboarding instructions.
How it works
Prelude receives and forwards the message
Prelude ingests the inbound message and sends a webhook event (
inbound.message.received) to your configured callback URL. The event includes the message content, sender phone number, and a message ID you can use to reply.You send a reply
Your application calls the Send a message endpoint with the
text and context.reply_to fields to send a reply within the 24-hour conversation window.Conversation window
WhatsApp enforces a 24-hour conversation window. You can only reply to an inbound message within 24 hours of when the user last messaged you. After the window expires, the API returns awindow_expired error.
Each new inbound message from the same user resets the 24-hour window.
Sending a reply
To reply to an inbound message, use the Send a message endpoint with thetext and context fields:
The reply message body. Required when
context.reply_to is provided.The inbound message ID (prefixed with
im_) to reply to. This ID is provided in the inbound.message.received webhook event.The
to field must match the phone number that sent the original inbound message. A phone_number_mismatch error is returned otherwise.SDK examples
Receiving inbound messages
To receive inbound WhatsApp messages, configure a webhook callback URL with your Customer Success Manager. When a user sends a message to your WhatsApp Business number, Prelude forwards it as aninbound.message.received webhook event.
Webhook event
The unique inbound message identifier (prefixed with
im_). Use this value in context.reply_to to send a reply.The channel the message was received on. Currently
whatsapp.The sender’s phone number in E.164 format.
Your WhatsApp Business phone number that received the message.
The text content of the inbound message.
The timestamp when the 24-hour conversation window expires. Replies must be sent before this time.
Error handling
The following errors are specific to 2-way messaging:| Error Code | Description | Action |
|---|---|---|
window_expired | The 24-hour conversation window has closed | Use a template-based message instead |
invalid_reply_context | The inbound message ID was not found | Verify the reply_to message ID |
phone_number_mismatch | The to number does not match the inbound message sender | Use the phone number from the inbound webhook event |
missing_text | The text field is empty or missing | Provide a reply message body |
Limitations
- Only text messages are supported for inbound messages. Media messages (images, videos, documents) are not forwarded.
- Replies are sent as free-form text, not as WhatsApp templates.
- 2-way messaging is only available through the WhatsApp channel via your connected WABA.
- The conversation window is 24 hours from the latest inbound message and cannot be extended.