WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The Create Contact operation in the WTS Chat n8n node allows you to create a new contact in your WTS system. This is useful for automating the process of adding leads, customers, or users into your CRM or communication platform. Typical scenarios include syncing contacts from other systems, onboarding new users, or enriching your contact database with additional metadata and custom fields.

Practical examples:

  • Automatically add new signups from a web form as contacts.
  • Import a list of leads from a spreadsheet, tagging them for segmentation.
  • Enrich existing contacts with Instagram handles or custom metadata.

Properties

Below are the input properties relevant to the "Contact" resource and "Create Contact" operation:

Display Name Type Description
Name string The name of the contact. Required for identification.
Tag Names or IDs multiOptions Tags to associate with the contact. You can select from a list or specify IDs using an expression.
Phone Number string The contact's phone number.
E-Mail string The contact's email address. Must be valid; otherwise, the node will throw an error.
Instagram string The contact's Instagram username.
Annotation string (multi-line) A note or annotation about the contact.
Upsert boolean If enabled, updates the contact if it already exists instead of creating a duplicate.
Get If Exists? boolean If enabled, returns the existing contact without updating any data if the contact already exists.
Custom Fields fixedCollection Add custom key-value pairs to store additional information. Keys are selected from available custom fields.
Metadata fixedCollection Add arbitrary key-value metadata to the contact.

Output

The output is a single item per execution, under the json field. The structure reflects the created (or found/updated) contact object as returned by the WTS API. While the exact fields depend on your WTS configuration, typical fields may include:

{
  "id": "string",
  "name": "string",
  "email": "string",
  "phonenumber": "string",
  "instagram": "string",
  "annotation": "string",
  "tagIds": ["string"],
  "customFields": { "key1": "value1", "key2": "value2" },
  "metadata": { "metaKey1": "metaValue1" },
  // ...other fields as provided by the WTS API
}
  • If the contact already exists and "Upsert" is enabled, the returned object will reflect updated data.
  • If "Get If Exists?" is enabled and the contact exists, the original data is returned without changes.

Note: No binary data is produced by this operation.


Dependencies

  • External Service: Requires access to the WTS API.
  • API Key: You must configure the wtsApi credential in n8n with a valid API key.
  • n8n Configuration: Ensure the node has network access to https://api.wts.chat.

Troubleshooting

Common Issues:

  • Invalid Email:

    • Error: "Invalid email!"
      Cause: The value in the "E-Mail" property does not match a standard email format.
      Solution: Enter a valid email address (e.g., user@example.com).
  • Missing Required Fields:

    • Error: May occur if required fields like "Name" are left empty (depending on your WTS setup).
      Solution: Ensure all mandatory fields are filled.
  • API Authentication Errors:

    • Error: Unauthorized or authentication failed.
      Cause: Invalid or missing API key in credentials.
      Solution: Check and update your wtsApi credentials in n8n.
  • Duplicate Contacts:

    • If "Upsert" and "Get If Exists?" are both disabled, attempting to create a contact that already exists may result in an error from the API.

Links and References


Discussion