| Field | Value |
|---|---|
| Method | GET and POST |
| Endpoint | GET: https://{{host}}/api/public/bot/{{botId}}/messages-lite?userId={{userId}}&limit=5&skip=0&offset=0 Or https://{{host}}/api/public/bot/{{botId}}/messages-lite?channelUId={{channelUId}}&channelType=whatsapp&limit=5 Note: Either userId or channelUIdis required. POST: https://{{host}}/api/public/bot/{{botId}}/messages-lite |
| Content Type | application/json |
| Authorization | auth: {{JWT}} See How to generate the JWT Token. |
| API Scope | App Builder: Chat History; Admin Console: Bot Analytics > Chat History |
Path Parameters
| Parameter | Required | Description |
|---|---|---|
host | Required | Environment URL, for example, https://platform.kore.ai. |
botId | Required | Bot ID or Stream ID. Access it on the bot’s General Settings page. |
Sample Request
GET Method: Query byuserId
channelUId (single value)
userId
channelUId (single value)
channelUId Array
Request Query Parameters (GET)
| Parameter | Required | Type | Description |
|---|---|---|---|
userId | Optional | String | User identifier. Required unless channelUId is provided. If both are supplied, userId takes precedence. |
channelUId | Optional | String or Array | Channel-side identifier such as phone number, email address, RTM handle, PSID. Pass the raw identifier; the platform constructs the internal format. Multi-value syntax: channelUId=a&channelUId=b |
channelType | Optional | String | Required if channelUId is provided. Channel type, for example whatsapp, email, rtm. Source channel, for example: rtm, whatsapp, email, web-sdk. Recommended when supplying channelUId for a single-channel lookup. Omit when passing a multi-value channelUId array to retrieve history across all channels. |
sessionId | Optional | String | Unique session identifier. |
dateFrom | Optional | String | Start date for filtering messages. Format: YYYY-MM-DD. |
dateTo | Optional | String | End date for filtering messages. Format: YYYY-MM-DD. |
isDeveloper | Optional | Boolean | Indicates if the query runs in developer mode. Default: false. |
includeCount | Optional | Boolean | When true, the response includes a total count of matching messages. Default: false. |
limit | Optional | Integer | The maximum number of messages returned per request is 1000, with a default of 5 messages if no limit is specified. |
skip | Optional | Integer | Number of records to skip before retrieving results. |
includeLatency | Optional | Boolean | When true, each outgoing (bot) message includes a latency object with segment-level timing data. Default: false. |
offset | Optional | Integer | Pagination offset value. |
Request Body Parameters (POST)
| Parameter | Required | Type | Description |
|---|---|---|---|
userId | Optional | String | User identifier. Required unless channelUId is provided. If both are supplied, userId takes precedence. |
channelUId | Optional | String or Array | Channel-side identifier such as phone number, email address, RTM handle, PSID. Pass the raw identifier; the platform constructs the internal format. Multi-value syntax: channelUId=a&channelUId=b |
channelType | Optional | String | Source channels such as rtm, whatsapp, email. Recommended for single-channel lookups using channelUId. Omit when passing a multi-value channelUId array to retrieve history across all channels. Omitting channelType enables retrieval across all matching channels. |
sessionId | Optional | String | Unique session identifier. |
dateFrom | Optional | String | Start date for filtering messages. Format: YYYY-MM-DD. |
dateTo | Optional | String | End date for filtering messages. Format: YYYY-MM-DD. |
includeLatency | Optional | Boolean | When true, each outgoing (bot) message includes a latency object with segment-level timing data. Default: false. |
type | Optional | Array | Message direction: incoming or outgoing. |
limit | Optional | Integer | Maximum number of messages to return. |
offset | Optional | Integer | Pagination offset value. |
skip | Optional | Integer | Number of records to skip. |
isDeveloper | Optional | Boolean | Indicates if the query runs in developer mode. |
includeCount | Optional | Boolean | When true, the response includes a total count of matching messages. Default: false. |
Sample Response
Response Body Parameters
| Parameter | Type | Description |
|---|---|---|
total | Integer | Total number of messages matching the query. |
moreAvailable | Boolean | Indicates whether more messages are available beyond the current response. |
messages | Array | Array of message objects. |
id | String | Unique identifier of the message. |
botId | String | Unique identifier of the bot. |
type | String | Direction: incoming or outgoing. |
status | String | Message status, such as pending or received. |
createdOn | String | ISO 8601 timestamp when the message was created. |
sessionId | String | Unique session identifier. |
lang | String | Language of the message. |
chnl | String | Channel through which the message was sent. |
components | Array | Array of message components. |
cT | String | Type of message component, such as text. |
data | Object | Object containing message content. |
channelUId | String | Unique identifier of the channel. |
total.Ms | Number | Total end-to-end latency from user utterance end to bot response playback start (ms). |
channels | String | Array of channels involved in the message, each with from, to, and channelUId fields. |
channels.from | String | Sender identifier for the channel, such as a phone number or email. |
channels.to | String | Recipient identifier for the channel, such as a phone number or email. |
channels.channelUId | String | Unique identifier for the channel interaction. |
latency | Object | Object containing latency details, present when includeLatency=true. |
latency.totalMs | String | Total end-to-end latency from user utterance end to bot response playback start (ms). |