ChatWoot icon

ChatWoot

Consume ChatWoot API

Overview

The ChatWoot node for n8n enables users to interact with the ChatWoot API. Specifically, when using the Public resource and the Get All Messages operation, this node retrieves all messages from a specified public conversation in ChatWoot. This is useful for scenarios where you need to fetch the entire message history of a public conversation, such as for archiving, analytics, or integrating conversation data into other workflows.

Practical examples:

  • Automatically exporting all messages from a public ChatWoot conversation to a Google Sheet.
  • Triggering alerts or follow-up actions based on the content of recent messages in a public conversation.
  • Aggregating customer support conversations for reporting or sentiment analysis.

Properties

Below are the input properties relevant to the Public resource and Get All Messages operation:

Display Name Type Meaning
Authentication options Selects the authentication method: either by parameters (manual entry) or predefined credentials.
BaseUrl string The base URL of your ChatWoot instance (e.g., https://chatwoot.org). Required if using parameter-based authentication.
Source ID string Internal source contact identifier, used for search. Should be URL-escaped or in HEX format.
Inbox Identifier string The identifier of the inbox from which to retrieve messages.
Conversation ID string The unique identifier of the conversation whose messages will be fetched.

Output

The output is an array of JSON objects, each representing a message from the specified public conversation. While the exact structure depends on the ChatWoot API response, typical fields may include:

[
  {
    "id": "string",
    "content": "string",
    "created_at": "timestamp",
    "sender": {
      "id": "string",
      "name": "string"
    },
    // ...other message fields
  }
]
  • Each object in the array corresponds to a single message.
  • Fields commonly include message ID, content, creation timestamp, sender information, and possibly additional metadata.

Dependencies

  • External Service: Requires access to a ChatWoot instance.
  • Authentication: Either via manually provided BaseUrl and token, or via predefined ChatWoot credentials configured in n8n.
  • n8n Configuration: If using predefined credentials, ensure that the credential type chatWootTokenApi is set up in n8n.

Troubleshooting

Common Issues:

  • Invalid Credentials: If authentication fails, check that your token and BaseUrl are correct and have sufficient permissions.
  • Missing Required Fields: Ensure that Inbox Identifier and Conversation ID are provided; otherwise, the node will throw an error.
  • Incorrect Source ID Format: The Source ID should be properly URL-escaped or in HEX format as required by your ChatWoot setup.

Error Messages:

  • "Authentication successful" / "Authentication failed": Indicates whether the provided credentials are valid.
  • "Cannot read property '...' of undefined": Usually means a required field was not supplied or is misspelled.
  • "Request failed with status code 404": The specified conversation or inbox does not exist.

How to resolve:

  • Double-check all required property values.
  • Verify that the ChatWoot instance is reachable from your n8n environment.
  • Ensure that the user associated with the token has access to the specified inbox and conversation.

Links and References

Discussion