message.received
Emitted when an inbound message (SMS, MMS, an iMessage, or a WhatsApp message) arrives on one of your Dial numbers. This is the event you wait for when receiving a one-time code or any inbound reply.
Messages sent to a group conversation arrive on this same event, carrying groupId.
Schema
Shares the common event envelope (id, object, type, version, createdAt, relatedObject). relatedObject is { id: <messageId>, type: "message", url: null } — messages have no get-by-id endpoint yet. The data payload:
Example
A group message
Same event, with the destination moved from to to groupId:
from is the participant who sent it. To know which of your numbers the conversation is on, read the message’s phoneNumberId from GET /api/v1/messages?groupId=grp_123.
A poll vote
A vote on a poll you sent. replyToId is the poll message; read GET /api/v1/messages for the poll’s current poll.options[].votes tally.
Filter on the poll with filters: { "replyToId": "msg_01HW3X7P5QF6K2YQ9YJ7Q8R5N2" } to wait for one poll’s votes.
When it fires
- Every time a message is delivered to one of your Dial numbers (SMS, MMS, an iMessage/RCS message on an iMessage number, or a WhatsApp message on a line with WhatsApp connected).
- For a message sent to a group your line is in — once per line that is in the group.
- For every vote and retracted vote on a poll you sent from an iMessage number.
- Once per inbound message — no retries on the stream itself.
- Internal test traffic (from dashboard or
/api/v1/test/*helpers) carriesdata.source: "internal"; ignore those unless you’re explicitly testing.