Common fields
callbackData
When you set the optional callbackData field on an outbound message, Connectly echoes it back at the top level of related webhook events:
- Delivery status events β
sent,delivered,read,delivery_failed - Inbound replies that reference the original message β quoted replies, button & list replies, reactions
callbackData is only present when it was set on the original outbound message. Plain-text inbound messages that donβt quote a prior message will not include it.
Business-scoped user IDs (BSUID)
On WhatsApp numbers with BSUID support enabled, the customer identifier carries two extra fields:userId and phoneNumber. For phone-less customers, id holds the BSUID and phoneNumber is "". The customer appears as sender on inbound message webhooks and as recipient on delivery-status webhooks. See BSUID for full details.
Inbound message payloads
Plain text
message.id identifies the customerβs message. Pass it to Send typing indicator while you prepare a reply.
Message with referral (Click-to-WhatsApp ad)
When a customer messages you directly from a Meta ad, the payload includes areferral object with ad attribution data.
Media attachment
When a customer sends an image, video, audio, or document, the payload includes anattachments array. Only one attachment is sent per webhook event.
type field indicates the media type. The file is accessible at url β when downloading programmatically, read the MIME type from the response Content-Type header.
Supported media types and MIME types:
Button response
When a customer taps an interactive button, the payload includes abuttonResponse object and a context object referencing the original message. If you set callbackData on the original outbound message, it is echoed back here.
buttonResponse.id identifies the tap. Pass it to Send typing indicator while you prepare a reply.
Delivery status payloads
Delivery status events are sent to yourdelivery_status topic endpoint. The statusUpdate.id field matches the message ID returned when you originally sent the message β use it to correlate events back to outbound messages.
Delivered
status field progresses through sent β delivered β read. Each transition generates a separate event.
Delivery failed
When delivery fails,status is delivery_failed and the error object provides details including a cntTraceId to share with Connectly support.
For the full list of error types and codes, see Error codes.
Opt status update payloads
Opt status updates are sent to youropt_status_update topic endpoint. Connectly sends one event per contact when an opt-out write changes whether you can message that contact on a channel: they opted out, or they opted back in. Use it to keep your CRMβs consent records in step with Connectly without polling.
The contact appears as recipient, and sender is null. The event itself is in optStatusUpdate.
Opted out
Opted back in
The top-level
timestamp is occurredAt in Unix seconds. For a contact known only by its BSUID, recipient.id holds the BSUID and recipient.phoneNumber is "".
Sources
other is sent for a change Connectly cannot attribute. New values may be added, so treat an unknown source as valid.
When events are sent
Connectly reports changes of state, not every request:opt_outis sent when a contact you could message gets their first opt-out on that channel.opt_inis sent when an opt-in clears the last opt-out the contact had on that channel.- A STOP from a contact who is already opted out sends nothing.
- An opt-in that leaves another opt-out in place sends nothing. For example, a contact who turns WhatsApp marketing back on but earlier replied STOP stays opted out, so no event is sent.
opt_out, and an opt_in can leave an uploaded opt-out in place. In that case the contact still receives nothing.
An opt-in keyword is the exception. It clears uploaded opt-outs too, and sends opt_in with source start_keyword even when an upload was the contactβs only opt-out, because the contact made that change. If you keep your own list and upload it again, take the contact off it first.
Filters
ThechannelTypes setting and a phoneNumbers filter apply to this topic. phoneNumbers matches the contactβs phone number, so a contact known only by its BSUID matches no phoneNumbers filter. A campaign_name filter has no effect: an opt-out belongs to no campaign, so every event is delivered. See Create webhook.