v1

latestOpenAPI 3.1.02026-07-1413113265.9 KB
chat

get all chats

Retrieves a list of all chats with their latest messages and metadata. Supports pagination.

post/instances/{id}/client/action/get-chats

Path parameters

idinteger required

Instance ID

Request body

offsetinteger

The number of items to skip before starting to collect the result set

limitinteger

The number of items to return

Example request

{
  "limit": 10
}

Response

Returns a list of chats with their metadata and latest messages

instanceIdstring
status'success' | 'error'

Example response

{
  "instanceId": "1",
  "data": [
    {
      "id": {
        "server": "c.us",
        "user": "xxxxxxxxxxxx",
        "_serialized": "xxxxxxxxxxxx@c.us"
      },
      "name": "Contact Name",
      "timestamp": 1738947027,
      "lastMessage": {
        "id": {
          "fromMe": true,
          "remote": "xxxxxxxxxxxx@c.us",
          "id": "XXXXXXXXXXXXXXXXXXXX",
          "_serialized": "true_xxxxxxxxxxxx@c.us_XXXXXXXXXXXXXXXXXXXX"
        },
        "body": "Message content",
        "type": "chat",
        "timestamp": 1738947027,
        "from": "xxxxxxxxxxxx@c.us",
        "to": "xxxxxxxxxxxx@c.us"
      }
    }
  ],
  "status": "success"
}