Messaging

Messages sent

The 'Messaging' event group has been introduced. It supports v1 events and is available for all integrators with an active Data Hub Subscription.

The following events can be subscribed upon:

  • messaging.message.sent: a new message is sent in a chat or groupchat conversation
  • messaging.message.delivered: a message has been delivered to the recipient
  • messaging.message.seen: a recipient has seen/read a message
  • messaging.message.treated: a participant has marked a message as treated (groupchat only)
  • messaging.message.driverSeen: a driver has seen the message sent by a group participant (groupchat only)

Events

messaging.message.sent

Contains all information that would be returned when doing a "Get messages" (GET /v1/conversations/messages) Datahub API call for that message. This includes the full message content, sender information, conversation context, and an initial statusHistory with status Pending.

The event is emitted for both chat (1:1) and groupchat conversations.

{
  "eventBatchId": "020db07f-6e95-470e-8cc0-a371f9deed2b",
  "eventSubscriptionId": "517db07f-6e95-475e-8cc0-a371f9deed2b",
  "eventBatchTime": "2026-03-03T10:30:15.683Z",
  "eventsData": [
    {
      "eventType": "messaging.message.sent",
      "eventVersion": 1,
      "eventData": {
        "registeredOn": "2026-03-03T10:30:15Z",
        "messageId": "a1234567-89ab-cdef-0123-456789abcdef",
        "conversationId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12:87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "conversationType": "chat",
        "sender": {
          "senderId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12",
          "roleType": "User"
        },
        "recipientId": "87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "contentType": "text",
        "content": "Hello, how are you?",
        "replyToMessageId": null,
        "statusHistory": {
          "currentStatus": "Pending",
          "lastUpdatedAt": "2026-03-03T10:30:15Z",
          "events": [
            {
              "status": "Pending",
              "timestamp": "2026-03-03T10:30:15Z"
            }
          ]
        }
      }
    }
  ]
}

messaging.message.delivered

Contains the same message structure as messaging.message.sent, with the statusHistory updated to reflect delivery. The statusHistory.events array will contain both the original Pending entry and the new Delivered entry with its timestamp.

In case of group conversation this event will come only the message is delivered to all the participants present in the group

Delivery is confirmed by ejabberd when the message reaches the recipient's device.

{
  "eventBatchId": "030db07f-6e95-470e-8cc0-a371f9deed2b",
  "eventSubscriptionId": "517db07f-6e95-475e-8cc0-a371f9deed2b",
  "eventBatchTime": "2026-03-03T10:30:20.123Z",
  "eventsData": [
    {
      "eventType": "messaging.message.delivered",
      "eventVersion": 1,
      "eventData": {
        "registeredOn": "2026-03-03T10:30:20Z",
        "messageId": "a1234567-89ab-cdef-0123-456789abcdef",
        "conversationId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12:87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "conversationType": "chat",
        "sender": {
          "senderId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12",
          "roleType": "User"
        },
        "recipientId": "87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "contentType": "text",
        "content": "Hello, how are you?",
        "replyToMessageId": null,
        "statusHistory": {
          "currentStatus": "Delivered",
          "lastUpdatedAt": "2026-03-03T10:30:20Z",
          "events": [
            {
              "status": "Pending",
              "timestamp": "2026-03-03T10:30:15Z"
            },
            {
              "status": "Delivered",
              "timestamp": "2026-03-03T10:30:20Z"
            }
          ]
        }
      }
    }
  ]
}

messaging.message.seen

Contains the same message structure as above, with the statusHistory updated to include a Seen entry. An additional participantId field identifies which participant marked the message as seen.

In case of group conversation this event will come only the message is seen by all the participants present in the group

This event is triggered when a user calls PATCH /v1/messages/actions/seen.

{
  "eventBatchId": "040db07f-6e95-470e-8cc0-a371f9deed2b",
  "eventSubscriptionId": "517db07f-6e95-475e-8cc0-a371f9deed2b",
  "eventBatchTime": "2026-03-03T10:30:30.456Z",
  "eventsData": [
    {
      "eventType": "messaging.message.seen",
      "eventVersion": 1,
      "eventData": {
        "registeredOn": "2026-03-03T10:30:30Z",
        "messageId": "a1234567-89ab-cdef-0123-456789abcdef",
        "conversationId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12:87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "conversationType": "chat",
        "sender": {
          "senderId": "3f94cfb0-7cac-46be-bba5-adfb1a24ee12",
          "roleType": "User"
        },
        "recipientId": "87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "contentType": "text",
        "content": "Hello, how are you?",
        "replyToMessageId": null,
        "participantId": "87bb1451-08c3-4bd6-b89b-2e4328af52f3",
        "statusHistory": {
          "currentStatus": "Seen",
          "lastUpdatedAt": "2026-03-03T10:30:30Z",
          "events": [
            {
              "status": "Pending",
              "timestamp": "2026-03-03T10:30:15Z"
            },
            {
              "status": "Delivered",
              "timestamp": "2026-03-03T10:30:20Z"
            },
            {
              "status": "Seen",
              "timestamp": "2026-03-03T10:30:30Z"
            }
          ]
        }
      }
    }
  ]
}

messaging.message.treated

Contains the same message structure, with the statusHistory updated to include a Treated entry. The Treated status event includes a participant object with the participantId and roleType of the participant who treated the message.

This event is only emitted for groupchat conversations.

This event is triggered when a user calls PATCH /v1/messages/actions/treat.

{
  "eventBatchId": "050db07f-6e95-470e-8cc0-a371f9deed2b",
  "eventSubscriptionId": "517db07f-6e95-475e-8cc0-a371f9deed2b",
  "eventBatchTime": "2026-03-03T10:30:45.789Z",
  "eventsData": [
    {
      "eventType": "messaging.message.treated",
      "eventVersion": 1,
      "eventData": {
        "registeredOn": "2026-03-03T10:30:45Z",
        "messageId": "a1234567-89ab-cdef-0123-456789abcdef",
        "conversationId": "c4df52df-8359-4e37-9dc4-e184c0d4b8ef",
        "conversationType": "groupchat",
        "sender": {
          "senderId": "7f94cfb0-7cac-46be-bba5-adfb1a24ee77",
          "roleType": "User"
        },
        "contentType": "text",
        "content": "Please check the delivery status for order #12345",
        "replyToMessageId": null,
        "statusHistory": {
          "currentStatus": "Treated",
          "lastUpdatedAt": "2026-03-03T10:30:45Z",
          "events": [
            {
              "status": "Pending",
              "timestamp": "2026-03-03T10:30:15Z"
            },
            {
              "status": "Delivered",
              "timestamp": "2026-03-03T10:30:20Z"
            },
            {
              "status": "Treated",
              "timestamp": "2026-03-03T10:30:45Z",
              "participant": {
                "participantId": "1e8ee916-ab83-4402-8048-0d949231d586",
                "roleType": "User"
              }
            }
          ]
        }
      }
    }
  ]
}

messaging.message.driverSeen

Contains the same message structure, with the statusHistory updated to include a DriverSeen entry. The DriverSeen status event includes a participant object with the participantId and roleType (Driver) of the driver who saw the message.

This event is only emitted for groupchat conversations.

{
  "eventBatchId": "060db07f-6e95-470e-8cc0-a371f9deed2b",
  "eventSubscriptionId": "517db07f-6e95-475e-8cc0-a371f9deed2b",
  "eventBatchTime": "2026-03-03T10:30:35.321Z",
  "eventsData": [
    {
      "eventType": "messaging.message.driverSeen",
      "eventVersion": 1,
      "eventData": {
        "registeredOn": "2026-03-03T10:30:35Z",
        "messageId": "a1234567-89ab-cdef-0123-456789abcdef",
        "conversationId": "c4df52df-8359-4e37-9dc4-e184c0d4b8ef",
        "conversationType": "groupchat",
        "sender": {
          "senderId": "7f94cfb0-7cac-46be-bba5-adfb1a24ee77",
          "roleType": "User"
        },
        "contentType": "text",
        "content": "Please check the delivery status for order #12345",
        "replyToMessageId": null,
        "statusHistory": {
          "currentStatus": "DriverSeen",
          "lastUpdatedAt": "2026-03-03T10:30:35Z",
          "events": [
            {
              "status": "Pending",
              "timestamp": "2026-03-03T10:30:15Z"
            },
            {
              "status": "Delivered",
              "timestamp": "2026-03-03T10:30:20Z"
            },
            {
              "status": "DriverSeen",
              "timestamp": "2026-03-03T10:30:35Z",
              "participant": {
                "participantId": "1e8ee916-ab83-4402-8048-0d949231d586",
                "roleType": "Driver"
              }
            }
          ]
        }
      }
    }
  ]
}

Status lifecycle

A message progresses through the following statuses. Each transition emits a separate event, and the statusHistory.events array is cumulative:

Pending → Delivered → Seen
                    → Treated      (groupchat only)
                    → DriverSeen   (groupchat only)

Remark that Treated and DriverSeen are independent of Seen — a message can be treated without being seen, and vice versa.

Business decisions

  • When an event is received it should not be needed to do a "Get messages" call afterwards to get more info on the update. Each event contains the full message payload including content, sender, and complete status history.
  • All messaging events follow the standard DHS event envelope with eventBatchId, eventSubscriptionId, eventBatchTime, and eventsData[].
  • Multiple messaging events for the same message can be batched together in a single Kafka message (e.g., a sent + delivered in one batch if they occur close together).
  • Message content is included in all status update events (delivered, seen, treated, driverSeen), not just the initial sent event.
  • treated and driverSeen events are scoped to group chat only — they are not emitted for 1:1 chat conversations.