Actions76
- Chat Actions
- Contact Actions
- Profile Actions
- LID Actions
- File Actions
- Message Actions
- Group Actions
- Create
- List
- Get
- Delete
- Join
- Get Join Info
- Leave
- Get Picture
- Set Picture
- Delete Picture
- Update Subject
- Update Description
- Get Security Info Admin Only
- Set Security Info Admin Only
- Get Security Messages Admin Only
- Set Security Messages Admin Only
- Get Participants
- Add Participant
- Remove Participant
- Promote Admin
- Demote Admin
- Status Actions
- Channel Actions
- Poll Actions
Overview
The "Mark Messages Read" operation in the Chat resource allows users to mark multiple messages as read in a specified chat on WhatsApp via the Wappfy API. This batch operation is useful for automating message management, ensuring that messages up to a certain count or within a recent time frame are marked as read without manually opening each message.
Common scenarios:
- Automatically marking recent messages as read after processing them in an automation workflow.
- Keeping chat notifications clean by marking older unread messages as read in bulk.
- Synchronizing message read status across systems integrated with WhatsApp.
Practical example:
You have a customer support chat and want to mark the last 30 messages from the past week as read once your system has processed them, preventing repeated notifications or alerts.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the chat where messages will be marked as read. |
| Messages Count | Number of recent messages to mark as read (e.g., 30). |
| Days | Time window in days to consider messages for marking as read (e.g., last 7 days). |
Output
The node outputs the JSON response returned by the Wappfy API after marking messages as read. This typically includes confirmation details about the operation's success or failure.
- The output is structured as a JSON object.
- No binary data is produced by this operation.
Example output structure (conceptual):
{
"success": true,
"markedMessagesCount": 30,
"chatId": "123456789@c.us"
}
Dependencies
- Requires a valid connection to the Wappfy API, including:
- Base URL of the Wappfy API instance.
- Instance name identifier.
- An API key credential for authentication.
- The node uses HTTP POST requests to the endpoint
/api/{instanceName}/chats/{chatId}/messages/readwith a JSON body specifying the number of messages and days.
Troubleshooting
Common issues:
- Invalid or missing Chat ID: Ensure the chat ID is correctly provided and corresponds to an existing chat.
- Insufficient permissions or invalid API key: Verify that the API key credential is valid and has rights to modify chat messages.
- Network or connectivity problems: Confirm that the Wappfy API base URL is reachable from the n8n environment.
Error messages:
"Chat not found": The specified chat ID does not exist or is incorrect."Unauthorized"or"Invalid API key": Authentication failed; check API key configuration."Bad Request": Likely caused by invalid parameters such as negative message count or days.
Resolution tips:
- Double-check input parameters for correctness.
- Validate API credentials and network access.
- Use smaller values for messages count and days if encountering request size limits.
Links and References
- Wappfy API Documentation (general reference for API endpoints)
- WhatsApp Business API Concepts (for understanding chat/message concepts)
Note: Replace links with actual URLs relevant to your Wappfy API documentation.