Back to API List
To fetch conversational messages between the bot and user in reverse chronological order. Supports pagination via offset/skip and limit parameters.
The Conversation History API provides timestamps in UTC format.
Field Value Method GET and POST Endpoint GET v1 : https://{{host}}/api/public/bot/{{botId}}/getMessages?userId={{userId}}&limit=10&dateFrom=2023-05-20&dateTo=2023-05-25 GET v2 : https://{{host}}/api/public/bot/{{botId}}/getMessagesV2?userId={{userId}}&includeSecureForm=true POST v1 : https://{{host}}/api/public/bot/{{botId}}/getMessages (or https://{{host}}/api/public/getMessages for Admin Console) POST v2 : https://{{host}}/api/public/bot/{{botId}}/getMessagesV2accept-encoding gzip, deflate, br — Recommended for v2 of both GET and POST methods.Content Type application/jsonAuthorization auth: {{JWT}} See How to generate the JWT Token .API Scope App Builder: Chat History; Admin Console: Bot Analytics > Chat History
Version differences : v1 includes messages for all tasks with a maximum of 100 messages per request. v2 excludes Alert and Action task messages and supports up to 10,000 messages per request.
Path Parameters
Parameter Required Description hostRequired Environment URL, for example, https://platform.kore.ai. botIdOptional Bot ID or Stream ID. Access it from the General Settings page of the bot.
Sample Request
GET v1:
curl -X GET \
'https: //{{host}}/api/public/bot/{{botId}}/getMessages?userId={{userId}}&limit=10&dateFrom=2023-05-20&dateTo=2023-05-25' \
--header 'auth: { {YOUR_JWT_ACCESS_TOKEN }}'
GET v2:
curl --location 'https: //{{host}}/api/public/bot/{{botId}}/getMessagesV2?userId={{userId}}&includeSecureForm=true' \
--header 'auth: { {YOUR_JWT_ACCESS_TOKEN }}' \
--header 'Content-Type: application/json'
POST v1:
curl -X POST \
'https: //{{host}}/api/public/bot/{{botId}}/getMessages' \
--header 'auth: { {YOUR_JWT_ACCESS_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{
"userId" : "u-xxxx-xxxxx-xxxx" ,
"skip" : 0 ,
"limit" : 100 ,
"dateFrom" : "2019-04-01" ,
"dateTo" : "2019-04-01" ,
"channelType" : "rcs" ,
"sessionId" : [ "5eadxxxxxxxxxxxxx" , "5ebxxxxxxxxxxxxxxx" ],
"includeTraceId" : "true"
}'
POST v2:
curl --location 'https: //{{host}}/api/public/bot/{{botId}}/getMessagesV2' \
--header 'auth: { {YOUR_JWT_ACCESS_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{
"userId" : "u-dd2d1106-0732-5f93-939c-8e423079xxxx"
}'
Specific call IDs (voice channels):
curl --location \
'https: //{{host}}/api/public/bot/{{botId}}/getMessages?limit=50&dateTo=2025-06-26&callId={{callId}}&dateFrom=2025-06-23&channelType={{channelType}}' \
--header 'Content-Type: application/json' \
--header 'auth: { {YOUR_JWT_ACCESS_TOKEN }}'
Request Query Parameters
Parameter Required Type Description userIdRequired for GET, optional for POST String The ID of the user (email or enterprise unique ID). skip/offsetOptional Number Number of sessions to skip. limitOptional Number Number of messages per page. channelTypeOptional String Channel type; default is rtm. Supported: msteams, twitter, spark, rtm, facebook, slack, kore, email, sms, wfacebook, ringcentral, jabber, yammer, alexa, twiliovoice, telegram, ivr, ivrVoice, smartassist, line, liveperson, googleactions, hangoutchat, mattermost, rcs. dateFromOptional Date Start date in yyyy-mm-dd or yyyy-mm-ddThh:mm:ss.msZ format. Cannot be used with msgId. dateToOptional Date End date in yyyy-mm-dd or yyyy-mm-ddThh:mm:ss.msZ format. Cannot be used with msgId. getAgentsInfoOptional Boolean If true, agent info is included in the response. includeSecureFormRequired (v2) Boolean Displays form input submitted by the user. sessionIdOptional A specific session ID.
The duration between dateTo and dateFrom must be less than 7 days.
Request Body Parameters
Parameter Required Type Description skip/offsetOptional Number of sessions to skip. limitOptional Number Number of messages per page. forwardOptional Boolean true for old-to-recent order, false for most-recent-to-oldest.msgIdOptional String A specific message ID to start retrieving from. Cannot be used with dateFrom/dateTo. includeTraceIdOptional Boolean true to include trace ID in the response.directionOptional (when msgId given) Number <0 reverse, =0 bidirectional, >0 forward.sessionIdOptional Array A specific session ID. tagsOptional Object Meta tags to filter conversations. getAgentsInfoOptional Boolean If true, agent info is included.
Sample Response
GET method:
{
"total" : 6 ,
"moreAvailable" : false ,
"messages" : [
{
"_id" : "ms-171c2f3d-dcdc-50f7-bfce-aeaa026cxxxx" ,
"botId" : "st-1d7611fa-908a-5f0c-8871-f7ea97a0xxxx" ,
"type" : "outgoing" ,
"status" : "pending" ,
"components" : [
{
"cT" : "text" ,
"data" : {
"text" : "Please enter intent"
}
}
],
"createdOn" : "2025-09-01T12:17:38.824Z" ,
"lang" : "en" ,
"sessionId" : "68b58ee2a0c1153e10cexxxx"
}
]
}
Response Body Parameters
Parameter Type Description totalNumber Total number of records matching the request parameters. moreAvailableBoolean true if more records are available; false if all records are returned.iconURL The URL of the bot logo. messagesArray Complete information about each message. messages._idString Unique identifier for the message record. messages.traceIdString Unique identifier associated with each incoming message. Retained for 30 days. messages.typeString Message type: incoming (user input) or outgoing (bot response). messages.statusString Processing status: received, queued, in progress, delivered, or pending. messages.createdByString User ID of the end user chatting with the bot. messages.channelsArray Channel metadata. messages.channels.typeString Channel name; default is rtm. messages.channels.channelUIdString End-user identity provided by the channel. messages.componentsArray Additional information about the message record. messages.langString Language of the conversation. messages.chnlString End user’s conversation channel. messages.tagsObject Meta tags for filtering conversations.