Message History
GET /message
Returns the message history for the active or pending chat. Bearer JWT is required.
Messages arrive in ascending createdAt order. The data structure varies by each record's type field; for all types see Message Types.
Request
GET /message HTTP/1.1
Host: widget-api.chatbot.aithinks.net
Authorization: Bearer <accessToken>
const history = await fetch(`${BASE_URL}/message`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
}).then((r) => r.json());
Successful response
[
{
"id": "97b56d6f-41d9-4037-ba2f-4d716ee284e0",
"createdAt": "2026-08-03T14:53:05.874Z",
"type": "TEXT",
"nameOfSender": "Jane Doe",
"isFromSupport": false,
"data": {
"text": "Bu odayı seç",
"payload": "btn_select_room_idx4"
}
},
{
"id": "1929c87c-257f-4fb8-a28f-ca63464a6f55",
"createdAt": "2026-07-24T04:54:16.716Z",
"type": "IMAGE",
"nameOfSender": "Support Bot",
"isFromSupport": true,
"data": {
"url": "https://os.chatbot.aithinks.net/chat-assets/chats/.../image.jpg",
"mime": "image/jpeg",
"path": "chats/.../image.jpg",
"size": 74701,
"caption": "Barkod Yazıcı Tanımlama",
"fileName": "image.jpg",
"extension": "jpg"
}
}
]
Response fields
Every element shares the same top-level structure:
| Field | Type | Description |
|---|---|---|
id | string | Message ID |
createdAt | string (ISO 8601) | Creation time |
type | string | Message type enum value |
data | object | Type-specific content |
nameOfSender | string | Sender name |
isFromSupport | boolean | true: bot/agent · false: visitor |
data schemas by type value:
| Type | Document |
|---|---|
TEXT | Text |
IMAGE | Image |
VIDEO | Video |
AUDIO | Audio |
FILE | File |
MULTIPLE_CHOICE | Multiple Choice |
MULTIPLE_CHOICE_REPLY | Multiple Choice Reply |
INTERACTIVE | Interactive |
CAROUSEL | Carousel |
TEMPLATE | Template |
Errors
| Status | Meaning |
|---|---|
401 | Invalid or missing JWT |
404 | Active chat not found (Chat not found) |