Chatwoot icon

Chatwoot

Interact with Chatwoot API

Overview

This node integrates with the Chatwoot API to update an existing contact within a specified account. It allows users to modify various contact details such as name, email, phone number, identifier, avatar URL, blocked status, and additional custom attributes.

Typical use cases include:

  • Keeping contact information up-to-date in Chatwoot from external systems.
  • Automating updates to contact profiles based on user interactions or CRM changes.
  • Managing contact blocking status programmatically.

For example, you might use this node to update a contact's phone number and add a new custom attribute like "city" after receiving updated data from a form submission.

Properties

Name Meaning
Account ID The numeric ID of the Chatwoot account where the contact exists.
Contact ID The numeric ID of the contact to update.
Name (Optional) The new name of the contact.
Email (Optional) The new email address of the contact.
Phone Number (Optional) The new phone number of the contact.
Identifier (Optional) A unique identifier for the contact.
Additional Fields Optional fields including:
• Avatar URL: URL to a JPG or PNG avatar image.
• Blocked: Whether the contact is blocked (boolean).
• Additional Attributes: Key-value pairs for extra contact attributes.
Custom Attributes Optional key-value pairs for custom attributes to be added or updated on the contact.
Continue on Fail Whether to continue executing subsequent items if this operation fails (boolean).

Output

The output is a JSON object representing the updated contact as returned by the Chatwoot API. It includes all standard contact fields along with any updated attributes.

Example structure (simplified):

{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com",
  "phone_number": "+1234567890",
  "identifier": "unique_id_123",
  "avatar_url": "https://example.com/avatar.jpg",
  "blocked": false,
  "custom_attributes": {
    "city": "San Francisco"
  },
  ...
}

No binary data output is produced by this operation.

Dependencies

  • Requires an active Chatwoot account and API access.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The node makes HTTP PUT requests to the Chatwoot API endpoint /api/v1/accounts/{accountId}/contacts/{contactId}.

Troubleshooting

  • Common issues:

    • Invalid or missing Account ID or Contact ID will cause the API request to fail.
    • Providing invalid URLs for avatar images may result in errors or ignored updates.
    • Incorrectly formatted custom attributes (e.g., missing keys or values) may not be applied.
    • Network or authentication errors if the API token is invalid or expired.
  • Error messages:

    • "404 Not Found": The specified account or contact does not exist. Verify IDs.
    • "401 Unauthorized": Authentication failed. Check API credentials.
    • "400 Bad Request": Invalid input data, such as malformed JSON or unsupported field values.
  • Resolution tips:

    • Double-check that Account ID and Contact ID are correct and correspond to existing entities.
    • Ensure the API key credential is valid and has sufficient permissions.
    • Validate all input fields, especially URLs and custom attributes.
    • Enable "Continue on Fail" to allow processing multiple items even if some fail.

Links and References

Discussion