Chatwoot icon

Chatwoot

Interact with Chatwoot API

Overview

This node integrates with the Chatwoot API to manage contacts within a specified account. Specifically, the Create Contact operation allows users to add new contacts to their Chatwoot account by providing essential details such as name, email, phone number, and unique identifiers. This is useful in scenarios where you want to automate the addition of customer or lead information into Chatwoot for further engagement or support.

Practical examples include:

  • Automatically creating a contact when a new lead is captured from a web form.
  • Importing user data from a CRM or marketing platform into Chatwoot.
  • Adding contacts programmatically during onboarding workflows.

Properties

Name Meaning
Account ID The numeric ID of the Chatwoot account where the contact will be created.
Name The full name of the contact (required).
Email The email address of the contact.
Phone Number The phone number of the contact, including country code if applicable.
Identifier A unique identifier string for the contact, useful for deduplication or external reference.
Additional Fields Optional extra fields for the contact:
- Avatar URL: URL to a JPG or PNG image representing the contact's avatar.
- Blocked: Boolean flag indicating if the contact is blocked.
- Additional Attributes: Key-value pairs for any other custom attributes.
Custom Attributes Multiple key-value pairs for custom attributes that can be assigned to the contact. These are separate from additional fields and allow flexible metadata storage.
Continue on Fail Whether the node should continue processing subsequent items if this operation fails (boolean).

Output

The output JSON object contains the response from the Chatwoot API after creating the contact. It includes all the details of the newly created contact as returned by the API, such as:

  • Contact ID
  • Name
  • Email
  • Phone number
  • Identifier
  • Custom attributes
  • Additional attributes
  • Other metadata managed by Chatwoot

If multiple input items are processed, the output is an array of such JSON objects, one per created contact.

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to the Chatwoot API via an API key credential configured in n8n.
  • The base URL of the Chatwoot instance must be set in the credentials.
  • The node uses HTTP requests to interact with the Chatwoot REST API endpoints.

Troubleshooting

  • Common issues:

    • Invalid or missing Account ID: Ensure the account ID is correct and accessible with your API key.
    • Missing required fields like Name: The API requires the contact name; omitting it will cause errors.
    • Network or authentication errors: Verify API key validity and network connectivity to the Chatwoot server.
    • Duplicate contacts: If using the same identifier repeatedly, the API may reject duplicates depending on configuration.
  • Error messages:

    • 400 Bad Request: Usually indicates missing or invalid parameters. Check that required fields are provided and correctly formatted.
    • 401 Unauthorized: Authentication failure; verify API key and permissions.
    • 404 Not Found: The specified account ID does not exist or is inaccessible.
    • 500 Internal Server Error: Server-side issue; retry later or check Chatwoot server status.
  • To handle errors gracefully, enable "Continue on Fail" to allow the workflow to proceed even if some contact creations fail.

Links and References

Discussion