curl -g "https://YOUR_PROJECT.texterchat.com/server/api/v2/messages/chat/67bf11038b24880cc966f799?beforeTime=1762012091000&beforeId=68ba8c904657483ffee3101e" \
-H "Authorization: Bearer YOUR_API_TOKEN"{
"messages": [
{
"_id": "68ba89f8c909657dffcf267c",
"chatChannelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972509876543"
},
"channelInfo": {
"id": "wamid.HBgMOTcyNTQ0NTU0ODUyFQIAEhgUM0ExNkMwMzdBN0Q0MDFEN0E4RUUA"
},
"direction": "incoming",
"parent_chat": "67a87067aeed4dee1271cb4d",
"status": 2,
"statusHistory": [
{
"status": 2,
"timestamp": 1757055477000
}
],
"text": "Hi",
"timestamp": 1757055477000,
"type": "text",
"updatedAt": "2025-09-05T06:58:01.651Z",
"metadata": {
"triggeredBot": true
},
"botSessionId": "c1125880930b372b0f1047cad91ab5aca4f1171993d8af709497d16f77772fa4"
}
],
"minTime": 1746616143295,
"maxTime": 1757056145969
}{
"error": "data must have required property 'botSessionId', data must have required property 'beforeId', data must match a schema in anyOf"
}Messages
Get Messages of a Chat
Retrieve messages from a specific chat. Messages are returned in ascending order (earliest to latest), up to limit messages (default 50).
GET
https://{projectID}.texterchat.com/server/api/v2
/
messages
/
chat
/
{chatId}
curl -g "https://YOUR_PROJECT.texterchat.com/server/api/v2/messages/chat/67bf11038b24880cc966f799?beforeTime=1762012091000&beforeId=68ba8c904657483ffee3101e" \
-H "Authorization: Bearer YOUR_API_TOKEN"{
"messages": [
{
"_id": "68ba89f8c909657dffcf267c",
"chatChannelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972509876543"
},
"channelInfo": {
"id": "wamid.HBgMOTcyNTQ0NTU0ODUyFQIAEhgUM0ExNkMwMzdBN0Q0MDFEN0E4RUUA"
},
"direction": "incoming",
"parent_chat": "67a87067aeed4dee1271cb4d",
"status": 2,
"statusHistory": [
{
"status": 2,
"timestamp": 1757055477000
}
],
"text": "Hi",
"timestamp": 1757055477000,
"type": "text",
"updatedAt": "2025-09-05T06:58:01.651Z",
"metadata": {
"triggeredBot": true
},
"botSessionId": "c1125880930b372b0f1047cad91ab5aca4f1171993d8af709497d16f77772fa4"
}
],
"minTime": 1746616143295,
"maxTime": 1757056145969
}{
"error": "data must have required property 'botSessionId', data must have required property 'beforeId', data must match a schema in anyOf"
}Required token scopes:
View all chats
A filter is required - provide either botSessionId, or both beforeTime and beforeId:
- Bot session - retrieve all messages from a specific bot session by providing
botSessionId. You can obtain this ID via Search Chats or Get Chat by Chat ID - the chat object includes abotStatefield (andpreviousBotSession) where you can find the sessionid. - Before time & before ID - cursor pagination, both parameters together: the response includes messages with a timestamp up to and including
beforeTime, excluding the message identified bybeforeId. To page backwards through history, pass the timestamp and_idof the oldest message you already have. If both filters are supplied,beforeTime/beforeIdpagination takes precedence andbotSessionIdis ignored.
הרשאות
פרמטרי נתיב
פרמטרי שאילתה
תגובה
The matching messages plus the time range of the entire chat. Field-by-field reference: The Message object