Actions148
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Files Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
Chats → Get Chats
AI-generatedOverview
This node interacts with the WaliChat WhatsApp API to retrieve chat data associated with a specified WhatsApp number. The "Get Chats" operation under the "Chats" resource allows users to fetch lists of chats filtered and sorted by various criteria such as status, unread messages, chat type, assigned agents, labels, and more.
Common scenarios where this node is beneficial include:
- Monitoring active or unresolved customer support chats.
- Extracting chats with unread messages for follow-up.
- Filtering chats by specific agents or labels for reporting.
- Retrieving detailed chat information including messages, notes, or participants.
Practical example: A customer support team can use this node to pull all active chats assigned to their agents that have unread messages, enabling them to prioritize responses efficiently.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) from which to retrieve chats. This identifies the source account. |
| Filters | A collection of optional filters to narrow down the chats returned: |
| - Status | Filter chats by their status. Options: Pending, Active, Resolved, Archived, Muted. |
| - Unread Only | If true, only chats with unread messages are returned. |
| - Active Chats Only | If true, only active chats/groups/channels are included. |
| - Can Send Messages | If true, only chats that can receive messages are included. |
| - Read-Only Chats | If true, only read-only chats that cannot accept messages are included. |
| - Chat Type | Filter chats by type. Options: Chat, Group, Channel, Community. |
| - Assigned Agent IDs | Filter chats assigned to specific agents by their IDs. Multiple values allowed. |
| - Search Term | Text search to match phone numbers, names, etc., within chats. |
| - Labels | Filter chats by labels. Multiple values allowed. Use * to include any labeled chat. |
| - Exclude Labels | Exclude chats with specific labels. Multiple values allowed. Use * to exclude any labeled chat. |
| - Include Items | Specify related data to include in the response. Options: Messages, Notes, Participants. |
| - Results Page Size | Number of results per page (pagination). Default is 20. |
| - Page Number | Page number for pagination, starting from 0. |
| - Sort | Sort order for results. Options: Most Recent First, Oldest First, Unread First, Name A-Z, Name Z-A. |
Output
The output is an array of JSON objects representing chats matching the specified filters. Each chat object includes details such as chat ID, name, status, unread count, type, assigned agents, labels, and optionally included related data like messages, notes, or participants depending on the "Include Items" filter.
If binary data were involved (not indicated here), it would typically represent media files or attachments related to chats, but this operation focuses on JSON chat metadata.
Dependencies
- Requires an API key credential for authenticating with the WaliChat WhatsApp API.
- The node depends on the WaliChat API service being accessible.
- Proper configuration of the WhatsApp number (device) in WaliChat is necessary.
- Pagination and filtering rely on supported API query parameters.
Troubleshooting
Common Issues:
- Invalid or missing WhatsApp number ID will cause failures retrieving chats.
- Using unsupported filter combinations may result in empty responses.
- Pagination parameters out of range might return no results.
- Network or authentication errors if the API key is invalid or expired.
Error Messages:
"error": "Invalid device ID"— Verify the WhatsApp number ID is correct and exists."error": "Unauthorized"— Check that the API key credential is valid and has required permissions."error": "Request failed"— Could indicate network issues; retry or check connectivity.
Resolutions:
- Confirm the WhatsApp number is properly set up and linked.
- Validate API credentials and refresh if needed.
- Adjust filters and pagination to valid values.
- Enable "Continue On Fail" in the node settings to handle partial failures gracefully.
Links and References
- WaliChat API Documentation (general reference for API endpoints and parameters)
- n8n Documentation on Creating Custom Nodes
- Best practices for Pagination and Filtering in APIs