# Read message history

List the messages and other events in a conversation.

API 4.0

Use this endpoint to read what happened in a conversation: messages from the customer and agents, plus other conversation events.

## Request

Send a `GET` request with the conversation ID in the path. There is no request body.

| Parameter | Type | Description |
| --- | --- | --- |
| `cid` (path) | string | Conversation ID. |
| `start_id` (query) | string | Optional. Event ID to page from. |
| `limit` (query) | integer | Optional. Number of events to request. |

To read further, pass an event ID from your previous result as `start_id`. The response has no `next_cursor` or total; do not page by offset.

## Response

A successful request returns HTTP `200` with a JSON **array** of events. There is no wrapper object. Selected fields:

```json
[
  {
    "id": "event_example",
    "account_id": "account_example",
    "type": "message_sent",
    "created": 1763107200000,
    "by": {
      "id": "user_example",
      "type": "user"
    },
    "data": {
      "message": {
        "conversation_id": "conversation_example",
        "format": "plaintext",
        "text": "Hi, is my order ready?"
      }
    }
  }
]
```

Treat an empty or `null` result as no events.

## Read events correctly

- **Check `type` first.** Not every event is a message. Read `data.message` only for message events such as `message_sent`.
- **Check the sender.** `by.type` tells you whether a customer (`user`) or staff member (`agent`) acted, and `by.id` identifies them.
- **Check the format.** A message can be plain text, a block tree, or attachments only. See [Message formats](/developers/messages/formats) and [Attachments](/developers/messages/attachments).
- **Deduplicate by `id`.** When syncing history with [webhook events](/developers/webhooks/payloads), use the event `id` to avoid storing a message twice.

`created` is in Unix milliseconds.

## HTTP request

Replace `YOUR_CID` with the conversation ID and `YOUR_ACCESS_TOKEN` with your token. Add `start_id` or `limit` to the query string when needed.

```http
GET https://api.subiz.com.vn/4.0/conversations/YOUR_CID/messages
Authorization: Bearer YOUR_ACCESS_TOKEN
```