Skip to main content
This page covers every type of webhook payload Connectly can POST to your endpoint. Message and delivery status events cover WhatsApp. Opt status updates can also cover SMS and RCS.

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 a referral object with ad attribution data.

Media attachment

When a customer sends an image, video, audio, or document, the payload includes an attachments array. Only one attachment is sent per webhook event.
The 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 a buttonResponse 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 your delivery_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

The 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.
Log the cntTraceId from every delivery_failed event. It’s the fastest way to diagnose a delivery failure 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 your opt_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_out is sent when a contact you could message gets their first opt-out on that channel.
  • opt_in is 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-outs uploaded from a file in the Connectly dashboard are your own records. They are never reported, in either direction, and they do not count toward the state above. So a contact on an uploaded list who replies STOP sends 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.
Events can arrive more than once and out of order. For example, a retried delivery can land after a newer event for the same contact. For each contact and channel, keep the event with the newest occurredAt and ignore older ones.

Filters

The channelTypes 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.