Skip to main content
These events track the lifecycle of each message — from the moment a contact sends it to the read confirmation. Use them to sync conversation history, trigger content-based automations, or monitor delivery failures.

Event list

EventWhen it fires
message.receivedA message arrives from a contact on any channel
message.sentThe AI agent or human agent sends a message
message.deliveredThe channel confirms the message was delivered to the device
message.readThe contact viewed the message (when the channel supports it)
message.failedThe send failed — channel unavailable, invalid number, etc.

message.received

When it fires

A new message from a contact arrives on any channel connected to the workspace. This includes text, image, audio, video, document, and location.

Payload

{
  "event": "message.received",
  "event_id": "evt_01HX4A1K9MFQR4YZDNV7P9WCE",
  "timestamp": "2026-04-19T14:30:00Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_01HX4A1K",
    "conversation_id": "conv_01HX3B2K",
    "contact_id": "cont_456",
    "channel_id": "chan_789",
    "channel_type": "whatsapp",
    "content": "Oi, gostaria de saber sobre os planos",
    "type": "text",
    "direction": "inbound",
    "media_url": null,
    "media_mime_type": null,
    "location": null,
    "received_at": "2026-04-19T14:30:00Z"
  }
}

Key fields

FieldTypeDescription
message_idstringUnique message ID
conversation_idstringID of the conversation the message belongs to
contact_idstringID of the sending contact
contentstring | nullMessage text (null for media without a caption)
typeenumtext, image, audio, video, document, location, sticker
directionenuminbound (from the contact)
media_urlstring | nullPre-signed media URL (expires in 24h)
media_mime_typestring | nullFile MIME type, e.g. image/jpeg
locationobject | null{ lat, lng, label } when type is location

Usage example

Use message.received to integrate with your CRM, trigger external automations, or route messages to your own support system. If type is something other than text, check media_url to access the file.

message.sent

When it fires

The AI agent or a human agent sends a message to the contact — whether via inbox, API, or automation.

Payload

{
  "event": "message.sent",
  "event_id": "evt_01HX4B3M2PGTS6YADOV8Q1XDF",
  "timestamp": "2026-04-19T14:30:45Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_01HX4B3M",
    "conversation_id": "conv_01HX3B2K",
    "contact_id": "cont_456",
    "channel_id": "chan_789",
    "channel_type": "whatsapp",
    "content": "Olá! Temos três planos disponíveis...",
    "type": "text",
    "direction": "outbound",
    "sent_by": "agt_101",
    "sent_by_type": "agent",
    "media_url": null,
    "sent_at": "2026-04-19T14:30:45Z"
  }
}

Key fields

FieldTypeDescription
directionenumAlways outbound
sent_bystringID of who sent it (agent or attendant)
sent_by_typeenumagent (AI) | attendant (human) | api | automation
sent_atstringISO 8601 timestamp of sending

Usage example

Use sent_by_type to separate metrics for messages sent by AI vs. humans in your performance dashboard.

message.delivered

When it fires

The channel (WhatsApp, Instagram, etc.) confirms the message reached the contact’s device. Not all channels support delivery confirmation — widget and Telegram do not emit this event.

Payload

{
  "event": "message.delivered",
  "event_id": "evt_01HX4C5P4RHTW7ZBEPV9S2YEG",
  "timestamp": "2026-04-19T14:31:02Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_01HX4B3M",
    "conversation_id": "conv_01HX3B2K",
    "contact_id": "cont_456",
    "channel_id": "chan_789",
    "channel_type": "whatsapp",
    "delivered_at": "2026-04-19T14:31:02Z"
  }
}

Key fields

FieldTypeDescription
message_idstringID of the message confirmed as delivered
delivered_atstringISO 8601 timestamp of the delivery confirmation

message.read

When it fires

The contact opened and viewed the message. Available only on channels that return read status — WhatsApp Business API and Instagram Direct.

Payload

{
  "event": "message.read",
  "event_id": "evt_01HX4D7Q5SJUW8ZCFQWA3ZFH",
  "timestamp": "2026-04-19T14:32:10Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_01HX4B3M",
    "conversation_id": "conv_01HX3B2K",
    "contact_id": "cont_456",
    "channel_id": "chan_789",
    "channel_type": "whatsapp",
    "read_at": "2026-04-19T14:32:10Z"
  }
}

Key fields

FieldTypeDescription
message_idstringID of the viewed message
read_atstringISO 8601 timestamp of the read
The message.read event is generated at the individual message level. If the contact opens the conversation, you may receive several read events in sequence for previously unread messages.

message.failed

When it fires

Sending a message failed. This can happen due to a number not registered on WhatsApp, a disconnected channel, an expired Instagram session, or any other channel error.

Payload

{
  "event": "message.failed",
  "event_id": "evt_01HX4E9R6TKXV9ADGRXB4AGI",
  "timestamp": "2026-04-19T14:30:51Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_01HX4B3M",
    "conversation_id": "conv_01HX3B2K",
    "contact_id": "cont_456",
    "channel_id": "chan_789",
    "channel_type": "whatsapp",
    "error_code": "131026",
    "error_message": "Message undeliverable — number not registered on WhatsApp",
    "failed_at": "2026-04-19T14:30:51Z"
  }
}

Key fields

FieldTypeDescription
error_codestringError code returned by the channel
error_messagestringHuman-readable error description
failed_atstringISO 8601 timestamp of the failure

Usage example

Monitor message.failed with alerts. Many consecutive failures on the same channel_id indicate the channel may be disconnected — check the channel.error event in parallel.