Maytapi icon

Maytapi

Integrate with Maytapi WhatsApp Unofficial API

Chat → Archive Chat

AI-generated

Overview

The "Archive Chat" operation in the Maytapi node allows users to archive or unarchive a specific WhatsApp conversation. Archiving a chat typically hides it from the main chat list without deleting it, helping users organize their conversations by removing clutter. Unarchiving restores the chat back to the active chat list.

This operation is useful for automating chat management workflows, such as:

  • Automatically archiving chats after a support ticket is closed.
  • Unarchiving chats when a customer sends a new message.
  • Organizing chats based on custom business rules or triggers.

Example use case: After finishing a customer interaction, an automation can archive the chat to keep the inbox clean, and later unarchive it if the customer re-engages.

Properties

Name Meaning
Phone ID Source Select how to provide the Phone ID: either "From Credentials" (uses Phone ID stored in credentials) or "Custom" (enter a custom Phone ID).
Phone ID The WhatsApp instance Phone ID to use (required if "Custom" Phone ID Source is selected).
Conversation ID The unique identifier of the conversation to archive/unarchive. Format examples: user phone with @c.us suffix or group ID with @g.us suffix.
Action Whether to "Add" (archive the chat) or "Remove" (unarchive the chat).

Output

The output JSON contains the response from the Maytapi API after performing the archive or unarchive action on the specified conversation. It typically includes success status and any relevant metadata returned by the API.

No binary data is produced by this operation.

Example output structure:

{
  "success": true,
  "message": "Chat archived successfully"
}

or

{
  "success": true,
  "message": "Chat unarchived successfully"
}

Dependencies

  • Requires an API key credential for the Maytapi WhatsApp Unofficial API.
  • The Phone ID must be provided either via credentials or as a custom input.
  • The node makes HTTP POST requests to Maytapi endpoints to perform the archive/unarchive actions.
  • Proper network connectivity to https://api.maytapi.com/api is required.

Troubleshooting

  • Missing Phone ID: If neither credentials nor custom Phone ID is provided, the node will throw an error stating that Phone ID is required.
  • Invalid Conversation ID: Ensure the conversation ID is correctly formatted (e.g., 905301234567@c.us for individual or 905301234567-1234567890@g.us for groups).
  • API Errors: Maytapi API may return errors if the conversation does not exist or the action is invalid. Check the error message for details.
  • Permission Issues: Make sure the API key has sufficient permissions to modify chat states.
  • Network Issues: Verify internet connectivity and that the Maytapi API endpoint is reachable.

Links and References

Discussion