curl -g "https://YOUR_PROJECT.texterchat.com/server/api/v2/chats/search?search=0521234567" \
-H "Authorization: Bearer YOUR_API_TOKEN"{
"data": [
{
"_id": "67bf11038b24880cc966f799",
"title": "John Doe",
"agent": {
"uid": null,
"displayName": ""
},
"channel": "whatsapp",
"entityPhone": "+972509876543",
"clientPhoneE164": "+972521234567",
"clientPhone": "+972521234567",
"created": "2025-02-26T13:02:58.353Z",
"botState": {},
"last_message_timestamp": 1762012091000,
"lastIncomingMessageTimestamp": 1762012091000,
"status": 3,
"unreadCount": 6,
"channelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972509876543"
},
"departmentId": null,
"resolvedUpdateTime": 1762012093,
"crmData": {
"aiTerminateReason": "Inactivity"
},
"externalBot": false,
"updatedAt": "2025-11-01T15:48:14.076Z"
}
],
"total": 1
}{
"error": "data/statuses/0 must be equal to one of the allowed values"
}Search Chats
Search for chats based on various query parameters. The most common use case is searching by the contact’s phone number using the search parameter.
curl -g "https://YOUR_PROJECT.texterchat.com/server/api/v2/chats/search?search=0521234567" \
-H "Authorization: Bearer YOUR_API_TOKEN"{
"data": [
{
"_id": "67bf11038b24880cc966f799",
"title": "John Doe",
"agent": {
"uid": null,
"displayName": ""
},
"channel": "whatsapp",
"entityPhone": "+972509876543",
"clientPhoneE164": "+972521234567",
"clientPhone": "+972521234567",
"created": "2025-02-26T13:02:58.353Z",
"botState": {},
"last_message_timestamp": 1762012091000,
"lastIncomingMessageTimestamp": 1762012091000,
"status": 3,
"unreadCount": 6,
"channelInfo": {
"name": "whatsapp",
"id": "972521234567",
"accountId": "972509876543"
},
"departmentId": null,
"resolvedUpdateTime": 1762012093,
"crmData": {
"aiTerminateReason": "Inactivity"
},
"externalBot": false,
"updatedAt": "2025-11-01T15:48:14.076Z"
}
],
"total": 1
}{
"error": "data/statuses/0 must be equal to one of the allowed values"
}List all chats
Results are sorted by last message time (newest first). Note: the chat objects returned by this endpoint do not include the lastMessage / lastText preview fields. Unrecognized query parameters are rejected with 400.
All status values, type enums and the ID cheat sheet: Enums & Common Fields.Authorizations
API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.
Query Parameters
Search by contact phone number or name (case-insensitive, minimum 2 characters)
2Filter by channel name. Must be used together with channel[accountId]
whatsapp, messenger, instagram, website_chat, email, sms Filter by channel account ID. Must be used together with channel[name]
Filter chats by label ID. Repeat the parameter to match multiple labels (chats matching any of the labels are returned). Up to 100 unique labels (duplicate IDs return 400)
1 - 100 elementsFilter chats by status name. Repeat the parameter to include multiple statuses (same behavior as labels[]). Note: use ASSIGNED (shown as "Taken" in Texter) and RESOLVED - values like SOLVED or TAKEN are rejected
1 - 5 elementsBOT, PENDING, ASSIGNED, RESOLVED, BULK Whether to include chats with no messages. By default, only chats that contain messages are returned
1, true, 0, false The maximum number of results to return (1-10000). Defaults to 30
^\d+$The number of results to skip before starting to return records
^\d+$Response
The matching chats and the total count. Field-by-field reference: The Chat object