Get Chat by Recipient
curl --request GET \
--url https://{projectID}.texterchat.com/server/api/v2/chats \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{projectID}.texterchat.com/server/api/v2/chats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{projectID}.texterchat.com/server/api/v2/chats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"title": "Niv Shteingart",
"channelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972549876543"
},
"departmentId": null,
"agent": {
"uid": null,
"displayName": ""
},
"status": 0,
"created": "2025-05-07T11:09:03.295Z",
"updatedAt": "2025-11-03T20:05:15.532Z",
"lastIncomingMessageTimestamp": 1762200310000,
"lastMessage": {
"type": "text",
"text": "מה שמך?"
},
"unreadCount": 2,
"botState": {
"id": "236ef058aa87c90536c33493d2024cd87055bdac4d64a0f22fd84fcb3cea6f8d"
},
"lastMessageTimestamp": 1762200315209
}
Chats
Get Chat by Recipient
Retrieve a chat’s public view addressed by channel + account + recipient phone number, without knowing the chat ID. Omit the channel and account to use your default channel account.
GET
https://{projectID}.texterchat.com/server/api/v2
/
chats
Get Chat by Recipient
curl --request GET \
--url https://{projectID}.texterchat.com/server/api/v2/chats \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{projectID}.texterchat.com/server/api/v2/chats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{projectID}.texterchat.com/server/api/v2/chats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"title": "Niv Shteingart",
"channelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972549876543"
},
"departmentId": null,
"agent": {
"uid": null,
"displayName": ""
},
"status": 0,
"created": "2025-05-07T11:09:03.295Z",
"updatedAt": "2025-11-03T20:05:15.532Z",
"lastIncomingMessageTimestamp": 1762200310000,
"lastMessage": {
"type": "text",
"text": "מה שמך?"
},
"unreadCount": 2,
"botState": {
"id": "236ef058aa87c90536c33493d2024cd87055bdac4d64a0f22fd84fcb3cea6f8d"
},
"lastMessageTimestamp": 1762200315209
}
Required token scopes:
Send session message
Returns the same trimmed public view as Get Chat by Chat ID - the natural way to fetch a chat by phone number without a prior search. Provide the recipient with query parameters:
to(required) - the recipient contact ID (phone number for phone-based channels, any common format, normalized automatically).channel+from- the channel name and channel account ID. Omit both to use your project’s default channel account (501 if none is configured).channelwithoutfromreturns 400;fromwithoutchannelis ignored.
GET /chats/{channel} (with from, to as query params), GET /chats/{channel}/{accountId} (with to as query param) and GET /chats/{channel}/{accountId}/{to}. When the recipient comes entirely from the path, lookup failures return 404 instead of 400.
All status values, type enums and the ID cheat sheet: Enums & Common Fields.הרשאות
פרמטרי שאילתה
תגובה
The public chat view. Field-by-field reference: The Chat object
The public chat view returned by Get Chat by ID. Note: this is a trimmed version of the chat - fields like _id, labels, crmData and displayName are not included, and botState is narrowed to its id only.