Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jihvijhojhviihogyuvi/whatsapp-api/llms.txt

Use this file to discover all available pages before exploring further.

GET /api/chats fetches all WhatsApp conversations available to the authenticated account and returns the most recent ones sorted by activity. Each chat entry includes display name, group/read-only flags, unread message count, pin and mute status, and a summary of the last message. This is useful for building an inbox view or for discovering the chat IDs you need to pass to /api/messages.

Endpoint

GET /api/chats?limit=20

Query Parameters

limit
integer
default:"20"
Maximum number of chats to return. Must be an integer between 1 and 100. Chats are sorted by timestamp (most recent first) before the limit is applied, so you always receive the freshest conversations.

Response Fields

ok
boolean
required
true on a successful response.
count
integer
required
The number of chat objects returned in the chats array. This may be less than limit if the account has fewer chats than requested.
chats
array
required
An array of chat summary objects, sorted by most recent activity first.

Example Request

curl "http://127.0.0.1:8790/api/chats?limit=2"

Example Response

{
  "ok": true,
  "count": 2,
  "chats": [
    {
      "id": "15551234567@c.us",
      "name": "Alice",
      "is_group": false,
      "is_read_only": false,
      "unread_count": 3,
      "timestamp": 1717250585,
      "archived": false,
      "pinned": true,
      "muted": false,
      "last_message": {
        "id": "true_15551234567@c.us_3EB0C767D97B2C123456",
        "from": "15551234567@c.us",
        "to": "me@c.us",
        "author": null,
        "from_me": false,
        "type": "chat",
        "body": "Are you free tomorrow?",
        "timestamp": 1717250585,
        "has_media": false
      }
    },
    {
      "id": "15559876543-1609459200@g.us",
      "name": "Team Standup",
      "is_group": true,
      "is_read_only": false,
      "unread_count": 0,
      "timestamp": 1717248000,
      "archived": false,
      "pinned": false,
      "muted": true,
      "last_message": {
        "id": "true_15559876543-1609459200@g.us_ABCDEF1234567890",
        "from": "15557654321@c.us",
        "to": "15559876543-1609459200@g.us",
        "author": "15557654321@c.us",
        "from_me": false,
        "type": "chat",
        "body": "Daily sync at 9am!",
        "timestamp": 1717248000,
        "has_media": false
      }
    }
  ]
}

Build docs developers (and LLMs) love