דלג לתוכן הראשי
GET
/
chats
/
search
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
}

הרשאות

Authorization
string
header
נדרש

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.

פרמטרי שאילתה

Search by contact phone number or name (case-insensitive, minimum 2 characters)

Minimum string length: 2
channel[name]
enum<string>

Filter by channel name. Must be used together with channel[accountId]

אפשרויות זמינות:
whatsapp,
messenger,
instagram,
website_chat,
email
channel[accountId]
string

Filter by channel account ID. Must be used together with channel[name]

labels[]
string[]

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

Maximum array length: 100
statuses[]
enum<string>[]

Filter 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

Maximum array length: 5
אפשרויות זמינות:
BOT,
PENDING,
ASSIGNED,
RESOLVED,
BULK
showNoMessages
enum<string>

Whether to include chats with no messages. By default, only chats that contain messages are returned

אפשרויות זמינות:
1,
true,
0,
false
limit
string

The maximum number of results to return (1-10000). Defaults to 30

Pattern: ^\d+$
skip
string

The number of results to skip before starting to return records

Pattern: ^\d+$

תגובה

The matching chats and the total count. Field-by-field reference: The Chat object

data
object[]

Chat objects matching the search criteria (without the lastMessage preview)

total
number

Total number of chats matching the query (ignoring pagination)