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/chat system. Specifically, the "Create Contact" operation allows users to add new contacts or update existing ones in the WTS database. It supports adding detailed contact information such as name, email, phone number, Instagram handle, annotations, tags, custom fields, and metadata.

Common scenarios where this node is beneficial include:

  • Automating the creation of new customer records from form submissions or lead generation tools.
  • Synchronizing contact data between different systems by creating or updating contacts programmatically.
  • Enriching contact profiles with custom fields and tags for better segmentation and targeting.

Practical example:

  • When a new user signs up on a website, their details can be sent to this node to create a contact record in WTS Chat, optionally tagging them and adding custom metadata for marketing campaigns.

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 via expressions.
Phone Number The contact's phone number.
E-Mail The contact's email address. Must be a valid email format.
Instagram The Instagram username of the contact.
Annotation A note or annotation about the contact. Supports multiline text.
Upsert Boolean flag indicating if the contact should be updated if it already exists (true), instead of creating a duplicate.
Get If Exists? Boolean flag indicating if the existing contact should be returned without updating when found.
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.
Metadata Additional metadata key-value pairs to attach to the contact. Multiple metadata entries can be added.

Output

The node outputs an array of JSON objects representing the created or updated contact(s). Each output item contains the full contact data as returned by the WTS API, including all standard and custom fields, tags, annotations, and metadata.

If the contact was upserted or retrieved due to existence flags, the output reflects the current state of that contact in the system.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the WTS Chat API using an API key credential configured in n8n.
  • The node depends on the WTS API endpoints for contact management.
  • No additional external services are required beyond the WTS API.

Troubleshooting

  • Invalid Email Error: If the provided email does not match a valid email pattern, the node throws an error "Invalid email!". Ensure the email input is correctly formatted.
  • API Authentication Errors: If the API key is missing or invalid, requests will fail. Verify that the API key credential is properly set up in n8n.
  • Duplicate Contacts: Without enabling "Upsert" or "Get If Exists?", creating a contact with existing identifiers may result in duplicates.
  • Missing Required Fields: While most fields are optional, providing at least a name or unique identifier helps avoid errors or unintended duplicates.
  • Expression Errors: When using expressions for tag IDs or custom field keys, ensure they resolve correctly to valid values.

Links and References


This summary focuses exclusively on the "Contact" resource and the "Create Contact" operation as requested.

Discussion