WTS Chat icon

WTS Chat

Get data from Wts API

Overview

This node integrates with the WTS Chat API to manage contacts within a CRM or messaging context. Specifically, the Create Contact operation allows users to add new contacts to the system or update existing ones based on provided data. It supports creating contacts with basic information such as name, email, phone number, Instagram handle, and annotations, as well as advanced features like tagging, custom fields, metadata, and upsert behavior.

Common scenarios where this node is beneficial include:

  • Automatically adding new leads or customers from external sources into the WTS Chat contact database.
  • Updating existing contact records when new information becomes available (e.g., updated phone number or tags).
  • Enriching contact profiles with custom metadata or notes for better segmentation and follow-up.
  • Integrating contact creation into automated workflows that trigger messaging or CRM updates.

Example use case:

  • When a new user signs up on a website, their details can be sent to this node to create or update their contact record in WTS Chat, enabling personalized communication via chatbots or agents.

Properties

Name Meaning
Name The full name of the contact to create.
Tag Names or IDs Select one or more tags to assign to the contact. Tags can be chosen from a list or specified by ID using expressions.
Phone Number The contact's phone number.
E-Mail The contact's email address. Must be a valid email format; otherwise, an error is thrown.
Instagram The Instagram username of the contact.
Annotation A note or annotation about the contact. Multi-line text input.
Upsert Boolean flag indicating if the contact should be updated if it already exists (true), or only created if new (false).
Get If Exists? Boolean flag indicating if the existing contact should be returned without updating if it already exists.
Custom Fields A collection of key-value pairs for custom fields associated with the contact. Keys can be selected from predefined options or specified by ID. Multiple custom fields can be added.
Metada A collection of arbitrary metadata key-value pairs to attach to the contact. Multiple entries allowed.

Output

The output of the Create Contact operation is a JSON object representing the created or updated contact as returned by the WTS Chat API. This typically includes all contact details such as identifiers, names, emails, phone numbers, tags, custom fields, metadata, and annotations.

If the operation uses the "Upsert" or "Get If Exists?" options, the output will reflect the existing contact data accordingly.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the WTS Chat API via an API key credential configured in n8n.
  • The node depends on internal services (WtsCoreService) to perform API calls for contact management.
  • Network access to https://api.wts.chat is required.

Troubleshooting

  • Invalid Email Error: If the email address provided does not match a standard email format, the node throws an "Invalid email!" error. Ensure the email is correctly formatted.
  • API Authentication Errors: If the API key is missing, invalid, or expired, the node will fail with authentication errors. Verify the API key credential configuration.
  • Missing Required Fields: While most fields are optional, providing at least a name or unique identifier is recommended to avoid ambiguous contact creation.
  • Upsert Conflicts: Using both "Upsert" and "Get If Exists?" flags may lead to unexpected behavior. Use them according to your intended logic—either update existing or just retrieve if exists.
  • Tag or Custom Field Loading Issues: If tag or custom field options do not load, check API connectivity and permissions.

Links and References

Discussion