> ## Documentation Index
> Fetch the complete documentation index at: https://docs.my-aichatbot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read history (API key)

> Page through a conversation's messages, oldest first, using seq as the bookmark.

Read the messages of a conversation your bot owns. Every message carries a `seq` number that only goes up, which makes it a safe bookmark for polling.

## Authorization

**Authorization** `string` *required*

`Bearer mac_live_…`

## Path parameters

**conversation\_id** `string` *required*

Must belong to the bot your key belongs to.

## Query parameters

**after\_seq** `number` (default: 0)

Return messages with a `seq` higher than this.

**limit** `number` (default: 50)

Between 1 and 100. Numbers outside that range are pulled back in.

## Response

This endpoint returns the data directly, without an `ok` wrapper.

**messages** `array`

Oldest first.

**properties**

**id** `string`

The message id. Use it with [Update a message](https://docs.my-aichatbot.com/api-reference/patch-message.md).

**seq** `number`

Position in the conversation. Strictly increasing.

**sender\_type** `string`

`visitor`, `member`, `operator`, `bot`, or `system`.

**blocks** `array`

The stored Block Kit blocks.

**block\_kit\_version** `string`

Currently `"1"`.

**mid** `string | null`

The `mid` the sender set, if any.

**text\_preview** `string`

A plain-text rendering of the blocks, up to 300 characters.

**created\_at** `string`

ISO 8601, UTC.

**edited\_at** `string | null`

When the blocks were last replaced.

**last\_seq** `number`

The highest `seq` in the conversation right now. When it matches your bookmark, you are up to date.

```bash curl theme={null}
curl "https://app.my-aichatbot.com/api/v1/conversations/$CONVERSATION_ID/messages?after_seq=0&limit=50" \
  -H "Authorization: Bearer $MAC_KEY"
```

```javascript Node.js theme={null}
const res = await fetch(
  `https://app.my-aichatbot.com/api/v1/conversations/${conversationId}/messages?after_seq=${bookmark}&limit=50`,
  { headers: { Authorization: `Bearer ${process.env.MAC_KEY}` } }
)

const { messages, last_seq } = await res.json()
```

```python Python theme={null}
import os, requests

res = requests.get(
    f"https://app.my-aichatbot.com/api/v1/conversations/{conversation_id}/messages",
    headers={"Authorization": f"Bearer {os.environ['MAC_KEY']}"},
    params={"after_seq": bookmark, "limit": 50},
)

messages, last_seq = res.json()["messages"], res.json()["last_seq"]
```

```json 200 OK theme={null}
{
  "messages": [
    {
      "id": "0f8c…",
      "seq": 14,
      "sender_type": "visitor",
      "blocks": [{ "type": "text", "text": "Where is my order?" }],
      "block_kit_version": "1",
      "mid": null,
      "text_preview": "Where is my order?",
      "created_at": "2026-07-17T03:15:12.398Z",
      "edited_at": null
    }
  ],
  "last_seq": 14
}
```

To poll, remember the highest `seq` you have seen and send it back as `after_seq`.

## Errors

| Status | Code | Meaning |
| - | - | - |
| `401` | `invalid_api_key` | Missing, broken, or revoked. |
| `404` | `conversation_not_found` | Unknown conversation, or it belongs to a different bot. |
| `429` | `rate_limited` | Over 300 reads per minute for this key. Wait for `retry_after` seconds. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.