ChatWoot icon

ChatWoot

Consume ChatWoot API

Overview

The ChatWoot n8n node, when configured with the "Public" resource and the "Get Contact Details" operation, retrieves detailed information about a contact from a ChatWoot instance using public API endpoints. This is useful for scenarios where you need to fetch contact details based on an internal identifier (Source ID) and an Inbox Identifier, such as integrating ChatWoot contacts into your CRM, automating support workflows, or enriching customer data in other systems.

Practical examples:

  • Automatically fetching contact details when a new message arrives in a public inbox.
  • Enriching leads in your marketing automation tool with ChatWoot contact data.
  • Validating if a contact exists in a specific ChatWoot inbox before sending automated replies.

Properties

Name Type Meaning
Authentication options Selects how to authenticate: either by providing parameters directly or using credentials.
BaseUrl string The base URL of your ChatWoot instance (e.g., https://chatwoot.org). Required for parameter-based authentication.
Source ID string Internal Source Contact Identifier used for searching the contact. Should be URL-escaped or in HEX format.
Inbox Identifier string The identifier of the ChatWoot inbox to search within. Required for the Public resource.

Output

The output will be a JSON object containing the contact details retrieved from ChatWoot. The exact structure depends on the ChatWoot API response, but typically includes fields such as:

{
  "id": 12345,
  "name": "John Doe",
  "email": "john@example.com",
  "phone_number": "+1234567890",
  "identifier": "source_id_value",
  "inbox_id": "inbox_identifier_value",
  // ...other contact fields as provided by ChatWoot
}
  • If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.

Dependencies

  • External Service: Requires access to a running ChatWoot instance.
  • Authentication: Either direct parameters (BaseUrl, Token) or predefined ChatWoot credentials must be configured.
  • n8n Configuration: Ensure that any required credentials are set up in n8n's credential manager.

Troubleshooting

Common Issues:

  • Invalid Credentials: If authentication fails, ensure the correct BaseUrl and Access Token are provided, or that the predefined credentials are valid.
  • Missing Required Fields: Both "Source ID" and "Inbox Identifier" must be provided; otherwise, the node may throw validation errors.
  • Incorrect Source ID Format: The Source ID should be properly URL-escaped or in HEX format as required by ChatWoot.

Error Messages:

  • "Authentication failed": Check your credentials and BaseUrl.
  • "Contact not found": Verify the Source ID and Inbox Identifier.
  • "Request failed with status code XXX": Indicates an HTTP error; check network connectivity and API endpoint correctness.

Links and References

Discussion