ChatWoot icon

ChatWoot

Interact with ChatWoot API

Actions100

Overview

The ChatWoot - Contacts API: Update A Contact node allows you to update the details of an existing contact in your ChatWoot inbox. This is useful for keeping customer information up-to-date, such as when a user changes their email, phone number, or other profile attributes. Common scenarios include synchronizing contact data from external systems (like CRMs), updating user profiles after form submissions, or enriching contact records with additional metadata.

Example use cases:

  • Automatically update a contact's email and name when they change it in your main application.
  • Add or modify custom attributes (e.g., subscription status, preferences) for segmentation or automation.
  • Update avatar images or phone numbers based on user actions.

Properties

Display Name Type Description
Inbox Identifier String The identifier obtained from API inbox channel. Required to specify which inbox to update.
Contact Identifier String The source ID of the contact, obtained when the contact was created. Required.
Identifier String External identifier of the contact. Optional.
Identifier Hash String Identifier hash prepared for HMAC authentication. Optional.
Email String Email address of the contact. Optional.
Name String Name of the contact. Optional.
Phone Number String Phone number of the contact. Optional.
Avatar Url String URL to a JPEG or PNG file for the user's avatar. Optional.
Custom Attributes JSON Custom attributes of the customer, provided as a JSON object. Optional.

Output

The node outputs a json field containing the updated contact's information as returned by the ChatWoot API. The structure typically includes:

  • Updated contact fields (such as name, email, phone number, etc.)
  • Any custom attributes that were set or modified
  • System-generated fields like IDs, timestamps, etc.

Example output:

{
  "id": 12345,
  "name": "Jane Doe",
  "email": "jane@example.com",
  "phone_number": "+1234567890",
  "avatar_url": "https://example.com/avatar.jpg",
  "custom_attributes": {
    "subscription_status": "active"
  },
  // ...other fields as provided by ChatWoot
}

Note: The exact output fields depend on the ChatWoot API response.

Dependencies

  • External Service: Requires access to a ChatWoot instance with API enabled.
  • API Key: You must provide valid ChatWoot API credentials (chatwootApi) in n8n.
  • Environment Variable: The base URL for ChatWoot is taken from the credentials ($credentials.url).

Troubleshooting

Common issues:

  • Missing or invalid identifiers: If Inbox Identifier or Contact Identifier are missing or incorrect, the API will likely return a "Not Found" or "Invalid Parameter" error.
  • Authentication errors: If the API key is missing or incorrect, you'll receive an authentication/authorization error.
  • Malformed custom attributes: If Custom Attributes is not valid JSON, the request may fail with a parsing error.
  • Invalid avatar URL: If the Avatar Url does not point to a valid image, the update may be rejected.

Error messages and resolutions:

  • "404 Not Found": Check that both the Inbox Identifier and Contact Identifier are correct and exist in ChatWoot.
  • "401 Unauthorized": Verify your ChatWoot API credentials in n8n.
  • "400 Bad Request": Ensure all required fields are filled and that optional fields (like custom attributes) are correctly formatted.

Links and References

Discussion