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

Request

  • Base URL: https://waapi.app/api/v1
  • URL: https://waapi.app/api/v1/instances/{id}/client/action/get-chats
  • Auth: HTTP bearer

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

Request reached the instance. data.status reports whether the action was carried out; on error data carries message and explanation. Payload: Returns a list of chats with their metadata and latest messages.

status'success' | 'error'

Whether the request reached the instance. success here does not mean the action was carried out — that is reported by data.status, which is the authoritative one. A malformed input arrives as status: success with data.status: error.

Example response

{
  "data": {
    "status": "success",
    "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"
}

Changes

No recorded changes to this operation across all 1 revision of this API.