SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node enables managing WhatsApp chats via the SparkBot WhatsApp API. Specifically, the "Delete Chat" operation allows users to delete a chat from a selected WhatsApp number (device). It supports optionally deleting the chat both from the backend system and the WhatsApp app itself, with an option to force deletion if removal on WhatsApp fails.

Common scenarios include:

  • Cleaning up old or irrelevant chats programmatically.
  • Automating chat management workflows in customer support or sales environments.
  • Removing sensitive or outdated conversations from both the system and WhatsApp devices.

Example use case: Automatically deleting resolved customer support chats from the system and WhatsApp app after a certain period.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) from which the chat will be deleted.
Chat ID The unique identifier of the chat to delete (e.g., user chat like 447362053576@c.us or group chat like 44736205357600000000@g.us).
Delete from WhatsApp Boolean flag indicating whether to also delete the chat on the WhatsApp app itself.
Force Delete Boolean flag to force marking the chat as removed when deletion on WhatsApp fails (only applicable if "Delete from WhatsApp" is true).

Output

The node outputs JSON data representing the result of the delete operation for each input item. This typically includes confirmation of successful deletion or error details if the operation failed.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the SparkBot WhatsApp API using an API key credential configured in n8n.
  • The node depends on the SparkBot API's ability to manage WhatsApp chats for the specified WhatsApp number.
  • Proper permissions and valid chat IDs are necessary to perform deletions.

Troubleshooting

  • Common issues:

    • Invalid or missing WhatsApp number/device ID.
    • Incorrect or non-existent chat ID.
    • Insufficient permissions or expired API key.
    • Network connectivity problems with the SparkBot API.
    • Attempting to delete a chat that does not exist or is already deleted.
  • Error messages:

    • Errors related to authentication usually indicate invalid or missing API credentials.
    • "Chat not found" errors suggest the provided chat ID is incorrect or the chat has been deleted.
    • Failures deleting on WhatsApp may occur; enabling "Force Delete" can mark the chat as removed despite these failures.
  • Resolutions:

    • Verify the WhatsApp number and chat ID inputs.
    • Ensure the API key credential is valid and has required permissions.
    • Check network connectivity and API service status.
    • Use the "Force Delete" option cautiously when WhatsApp deletion fails.

Links and References

Discussion