CRMchat APIBeta
Dialogs

Find dialogs

POST
/workspaces/{workspaceId}/dialogs/find

Finds dialogs across Telegram accounts accessible to the authenticated user. Matches by peer ID, username, or either value when both are provided, and returns the most recently updated dialogs first.

Authorization

bearerAuth
AuthorizationBearer <token>

API key (sk_...) as Bearer token

In: header

Path Parameters

workspaceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

peerId?number

Telegram peer ID to match

username?string

Telegram username to match, with or without @

limit?integer

Maximum number of dialogs to return

Range1 <= value <= 20
Default20

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/workspaces/string/dialogs/find" \  -H "Content-Type: application/json" \  -d '{}'
[  {    "workspaceId": "string",    "accountId": "string",    "peerId": 0,    "updatedAt": "2019-08-24T14:15:22Z",    "usernames": [      "string"    ],    "usernamesNormalized": [      "string"    ],    "unread": true,    "unreadCount": 0,    "lastMessageDate": "2019-08-24T14:15:22Z",    "firstName": "string",    "lastName": "string",    "hasPhoto": true,    "lastSeenStatus": "online",    "lastSeenAt": "2019-08-24T14:15:22Z"  }]