get_whatsapp_chats
Comprehensive WhatsApp chat retrieval tool supporting all chat operations through a unified action-based interface. Perfect for accessing chat lists, searching conversations, filtering by various criteria, and managing chat data. Supports all WhatsApp chat retrieval operations with consistent formatting.
Available actions:
recent: Most recent chats
unread: Chats with unread messages
by_status: Filter by chat status (pending, active, resolved, archived...)
assigned: Chats assigned to an agent or department, or to anyone
unassigned: Chats nobody is handling yet
by_contact_type: Filter by chat type (chat, group, community, channel)
by_id: One chat by its WhatsApp ID
search: Free text search over phone, name, contact, company, metadata and private notes
archived: Archived chats
by_date_range: Chats by last message, first message or last inbound message date
Every action accepts labels, labelsExclude, status and contactTypes as extra filters. To find leads that went quiet, use by_date_range with activityType "lastInbound" and a toDate: those are the chats where the customer has not written since then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Results page, starting at 0 | |
| sort | No | Result order. Defaults to the API order (most recent activity first) | |
| limit | No | Number of WhatsApp chats per call (max 100) | |
| query | No | Free text to search for (required for search action) | |
| action | No | Chat retrieval action to perform | recent |
| chatId | No | Specific chat ID (required for by_id action) | |
| device | Yes | WhatsApp device ID connected to Wassenger (24 character hexadecimal string) | |
| fields | No | Explicit dot-path allowlist, e.g. ['id','name','contact.phone','unreadCount']. Overrides verbosity when set. | |
| labels | No | Only chats carrying at least one of these labels. Use ["*"] for any label. Cannot be combined with labelsExclude | |
| status | No | Filter by chat status (required for by_status action, optional elsewhere) | |
| toDate | No | End date (for by_date_range and archived actions) | |
| agentId | No | Filter by assigned agent ID (for assigned action) | |
| fromDate | No | Start date (for by_date_range and archived actions) | |
| verbosity | No | Response detail level: summary = curated high-signal fields (default, token-lean); standard = broader set; full = complete chat objects (escape hatch). | summary |
| activityType | No | Which date the range applies to: last message of any side, first message ever, or last message received from the customer | lastMessage |
| contactTypes | No | Filter by chat type (required for by_contact_type action, optional elsewhere) | |
| departmentId | No | Filter by assigned department ID (for assigned action) | |
| labelsExclude | No | Exclude chats carrying any of these labels. Use ["*"] to exclude every labelled chat |