Skip to main content
GET
/
chats
Get full or filtered list of all chats in the Workspace.
curl --request GET \
  --url https://app.timelines.ai/integrations/api/chats \
  --header 'Authorization: Bearer <token>'
{
  "status": "ok",
  "data": {
    "has_more_pages": true,
    "chats": [
      {
        "id": "1000001",
        "name": "John Doe",
        "jid": "14840000000@s.whatsapp.net",
        "is_group": false,
        "closed": false,
        "read": true,
        "labels": [
          "label1",
          "label2",
          "label3"
        ],
        "chatgpt_autoresponse_enabled": true,
        "whatsapp_account_id": "972502222222@s.whatsapp.net",
        "chat_url": "https://app.timelines.ai/chat/1000001/messages/",
        "created_timestamp": "2024-01-08 10:35:18 +0200",
        "unattended": false,
        "photo": "https://acme.com/logo.png",
        "phone": "+972501111111",
        "responsible_email": "kate.smitch@acme.com",
        "responsible_name": "Kate Smith",
        "last_message_uid": "4f43a9a0-b87e-4667-adfd-689674c3326c",
        "last_message_timestamp": "2024-01-29 13:55:04 +0200",
        "group_members": [
          {
            "name": "John Doe",
            "phone": "+972502222222",
            "role": "admin",
            "chat_id": 123456
          }
        ],
        "is_allowed_to_message": true
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

label
string

filters chats having at least one of specified labels (comma-separated)

whatsapp_account_id
string

filters chats belonging to one of the specified WhatsApp accounts (in wid format, comma-separated)

group
boolean

filters chats that are either group chats (true) or direct chats (false)

responsible
string

filters chats assigned to specific users (denoted by email address, comma-separated)

name
string

filter chats that contain any of specified strings (case-insensitive, comma-separated). Note: a string containing a whitespace will be matched as exact substring without being split to words.

phone
string

Filter direct (non-group) chats by a single phone number. Phone is sanitized in the same way as for sending messages. If sanitized value starts with '+', the match is exact. Otherwise, leading zeroes are removed and the number is matched as a substring of the stored phone. Group chats are always excluded when this parameter is used.

read
boolean

filter chats that are either read (true) or unread (false)

closed
boolean

filter chats that are either closed (true) or open (false)

chatgpt_autoresponse_enabled
boolean

filter chats where chatgpt auto-response is enabled (true) or disabled (false)

page
integer

specify the page of results (each page contains up to 50 items), starting with 1. Check "has more page" response value to see if more pages are available.

created_after
string<date-time>

filter chats that were created after this timestamp, can be specified with created_before

created_before
string<date-time>

filter chats that were created before this timestamp, can be specified with created_after

Response

Success

status
enum<string>
required
Available options:
ok,
error
Example:

"ok"

data
object
required