2-way messaging requires a connected WhatsApp Business Account (WABA). See the WhatsApp BSP guide for onboarding instructions.
How it works
1
User sends a WhatsApp message
A user sends a text message to your WhatsApp Business number.
2
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.3
You send a reply
Your application calls the Reply to an inbound message endpoint with the
to, text, and reply_to fields to send a reply within the 24-hour conversation window.4
User receives a reply
The user sees your reply as a native WhatsApp message.
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 dedicated Reply to an inbound message endpoint:string
required
The recipient’s phone number in E.164 format. Must match the phone number that sent the original inbound message.
string
required
The reply message body, sent as a free-form WhatsApp text.
string
required
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
string
The unique inbound message identifier (prefixed with
im_). Use this value in context.reply_to to send a reply.string
The channel the message was received on. Currently
whatsapp.string
The sender’s phone number in E.164 format.
string
Your WhatsApp Business phone number that received the message.
string
The text content of the inbound message.
RFC3339 date string
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: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.