List all chats
chats.list_chats(ChatListChatsParams**kwargs) -> SyncListChatsPagination[Chat]
GET/v3/chats
Retrieves a paginated list of chats for the authenticated partner.
Filtering:
- If
fromis provided, returns chats for that specific phone number - If
fromis omitted, returns chats across all phone numbers owned by the partner - If
tois provided, only returns chats where the specified handle is a participant
Pagination:
- Use
limitto control page size (default: 20, max: 100) - The response includes
next_cursorfor fetching the next page - When
next_cursorisnull, there are no more results to fetch - Pass the
next_cursorvalue as thecursorparameter for the next request
Example pagination flow:
- First request:
GET /v3/chats?from=%2B12223334444&limit=20 - Response includes
next_cursor: "20"(more results exist) - Next request:
GET /v3/chats?from=%2B12223334444&limit=20&cursor=20 - Response includes
next_cursor: null(no more results)
Parameters
cursor: Optional[str]
Pagination cursor from the previous responseโs next_cursor field.
Omit this parameter for the first page of results.
from_: Optional[str]
Phone number to filter chats by. Returns chats made from this phone number.
Must be in E.164 format (e.g., +13343284472). The + is automatically URL-encoded by HTTP clients.
If omitted, returns chats across all phone numbers owned by the partner.
to: Optional[str]
Filter chats by a participant handle. Only returns chats where this handle is a participant.
Can be an E.164 phone number (e.g., +13343284472) or an email address (e.g., [email protected]).
For phone numbers, the + is automatically URL-encoded by HTTP clients.
List all chats
import os
from linq import LinqAPIV3
client = LinqAPIV3(
api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted
)
page = client.chats.list_chats()
page = page.chats[0]
print(page.id){
"chats": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2024-01-15T10:30:00Z",
"display_name": "+14155551234, +14155559876",
"handles": [
{
"id": "550e8400-e29b-41d4-a716-446655440010",
"handle": "+14155551234",
"joined_at": "2025-05-21T15:30:00.000Z",
"service": "iMessage",
"is_me": true,
"left_at": "2019-12-27T18:11:19.117Z",
"status": "active"
},
{
"id": "550e8400-e29b-41d4-a716-446655440011",
"handle": "+14155559876",
"joined_at": "2025-05-21T15:30:00.000Z",
"service": "iMessage",
"is_me": false,
"left_at": "2019-12-27T18:11:19.117Z",
"status": "active"
}
],
"is_archived": true,
"is_group": true,
"updated_at": "2024-01-15T10:30:00Z",
"health_score": {
"reason": "Not enough engagement",
"score": 35,
"updated_at": "2026-05-01T18:28:25Z"
},
"service": "iMessage"
}
],
"next_cursor": "next_cursor"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}Returns Examples
{
"chats": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2024-01-15T10:30:00Z",
"display_name": "+14155551234, +14155559876",
"handles": [
{
"id": "550e8400-e29b-41d4-a716-446655440010",
"handle": "+14155551234",
"joined_at": "2025-05-21T15:30:00.000Z",
"service": "iMessage",
"is_me": true,
"left_at": "2019-12-27T18:11:19.117Z",
"status": "active"
},
{
"id": "550e8400-e29b-41d4-a716-446655440011",
"handle": "+14155559876",
"joined_at": "2025-05-21T15:30:00.000Z",
"service": "iMessage",
"is_me": false,
"left_at": "2019-12-27T18:11:19.117Z",
"status": "active"
}
],
"is_archived": true,
"is_group": true,
"updated_at": "2024-01-15T10:30:00Z",
"health_score": {
"reason": "Not enough engagement",
"score": 35,
"updated_at": "2026-05-01T18:28:25Z"
},
"service": "iMessage"
}
],
"next_cursor": "next_cursor"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}