Chatwoot icon

Chatwoot

Interact with Chatwoot API

Overview

The node integrates with the Chatwoot API to manage contacts and other resources. Specifically, the Contact - Search operation allows users to search for contacts within a Chatwoot account using a query string. This is useful for finding specific contacts by email, name, phone number, or other searchable attributes.

Typical use cases include:

  • Quickly locating a contact record before updating or messaging.
  • Filtering contacts based on partial information.
  • Automating workflows that require retrieving contact details dynamically.

For example, you might search for a contact by their email address "john@example.com" to retrieve their profile and interaction history.

Properties

Name Meaning
Search Query The query string used to search contacts (e.g., an email, name, or phone number).
Additional Options Optional parameters to refine the search:
- Page: The page number for paginated results (minimum 1).
- Sort: Attribute to sort the results by. Options include:
- Email (A-Z) / Email (Z-A)
- Last Activity (Newest / Oldest)
- Name (A-Z) / Name (Z-A)
- Phone Number (A-Z) / Phone Number (Z-A)
Continue on Fail Whether to continue processing subsequent items if this operation fails (boolean).
Debug Logging Whether to output detailed request and response logs to the console for debugging (boolean).

Output

The output is an array of JSON objects representing the contacts matching the search query. Each item corresponds to one contact's data as returned by the Chatwoot API. The structure includes all standard contact fields such as name, email, phone number, and any custom attributes defined in Chatwoot.

No binary data is produced by this operation.

Example output snippet (simplified):

[
  {
    "json": {
      "id": 123,
      "name": "John Doe",
      "email": "john@example.com",
      "phone_number": "+1234567890",
      "last_activity_at": "2024-01-01T12:00:00Z",
      ...
    }
  },
  ...
]

Dependencies

  • Requires an API key credential for authenticating with the Chatwoot API.
  • The node uses HTTP requests to communicate with the Chatwoot REST API endpoints.
  • The base URL and account ID are obtained from the configured credentials.
  • No additional external dependencies beyond the Chatwoot API and n8n core helpers.

Troubleshooting

  • Invalid JSON errors: If using JSON input fields elsewhere in the node, ensure JSON syntax is correct to avoid parsing errors.
  • Authentication failures: Verify that the API key credential is valid and has access to the specified Chatwoot account.
  • Empty results: Confirm the search query matches existing contacts; also check pagination and sorting options.
  • API rate limits or network issues: May cause request failures; enable debug logging to inspect request details.
  • Continue on Fail: If enabled, errors will be captured in the output instead of stopping execution, which can help identify problematic inputs.

Links and References

Discussion