WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The WTS Chat node's "Contact" resource with the "Update Contact" operation allows you to update specific fields of an existing contact in your WTS system. This is useful for keeping contact information up-to-date, such as changing names, phone numbers, emails, tags, custom fields, or marketing tracking data (UTM parameters). Typical scenarios include synchronizing CRM data, updating user profiles after form submissions, or managing contact segmentation.

Example use cases:

  • Automatically update a contact’s status when they complete a workflow.
  • Add or remove tags based on user actions.
  • Update UTM parameters for marketing attribution.
  • Change contact details from another integrated system.

Properties

Below are the input properties available for this operation. Only the fields selected in Fields will be updated.

Display Name Type Description
Contact ID String The unique identifier of the contact to update.
Fields Multi-Options Select which fields you want to update (e.g., Name, Email, Tags, etc.).
Name String New name for the contact. Visible if "Name" is selected in Fields.
Phonenumber String New phone number. Visible if "PhoneNumber" is selected in Fields.
Email String New email address. Visible if "Email" is selected in Fields.
Instagram String Instagram handle. Visible if "Instagram" is selected in Fields.
Annotation String Annotation or note for the contact. Visible if "Annotation" is selected in Fields.
Tag Names or IDs Multi-Options Tags to assign. Choose from list or specify IDs. Visible if "Tags" is selected in Fields.
Portfolio Names or IDs Multi-Options Portfolios to assign. Visible if "Portfolio" is selected in Fields.
Sequence Names or IDs Multi-Options Sequences to assign. Visible if "SequenceIds" is selected in Fields.
Status Options Status of the contact (Active, Archived, Blocked, Empty). Visible if "Status" is selected.
Picture Url String URL to the contact's picture. Visible if "PictureUrl" is selected in Fields.
Custom Fields Fixed Collection Key-value pairs for custom fields. Visible if "CustomFields" is selected in Fields.
Metadata Fixed Collection Key-value pairs for metadata. Visible if "Metadata" is selected in Fields.
Source UTM String UTM source. Visible if "Utm" is selected in Fields.
Medium UTM String UTM medium. Visible if "Utm" is selected in Fields.
Campaign UTM String UTM campaign. Visible if "Utm" is selected in Fields.
Content UTM String UTM content. Visible if "Utm" is selected in Fields.
Headline UTM String UTM headline. Visible if "Utm" is selected in Fields.
Term UTM String UTM term. Visible if "Utm" is selected in Fields.
Referral Url UTM String UTM referral URL. Visible if "Utm" is selected in Fields.

Note: Only the fields selected in Fields will be included in the update request.


Output

The output is a single item per execution, containing the updated contact's data in the json field. The structure reflects the contact object as returned by the WTS API after the update.

Example output:

{
  "json": {
    "id": "contact_123",
    "name": "Updated Name",
    "phonenumber": "+1234567890",
    "email": "updated@example.com",
    "tags": ["tag1", "tag2"],
    "customFields": {
      "fieldKey": "value"
    },
    "metadata": {
      "source": "webform"
    },
    "utm": {
      "source": "newsletter",
      "medium": "email",
      "campaign": "spring_sale"
    },
    // ...other contact fields
  }
}
  • The actual fields present depend on what was updated and the API response.
  • No binary data is produced by this operation.

Dependencies

  • External Service: Requires access to the WTS API.
  • API Key: You must configure valid WTS API credentials (wtsApi) in n8n.
  • n8n Configuration: Ensure the node has access to the required credentials and that the base URL (https://api.wts.chat) is reachable.

Troubleshooting

Common issues:

  • Missing Contact ID: If the "Contact ID" is empty or only whitespace, the node will throw an error:
    "ContactID is empty, please fill it in"
  • No Fields Selected: If no fields are selected in "Fields," nothing will be updated.
  • Invalid Field Values: Providing invalid values (e.g., malformed email) may result in API errors.
  • Permission Issues: Invalid or missing API key will cause authentication errors.
  • Field Visibility: Some fields only appear if their corresponding option is selected in "Fields."

How to resolve:

  • Always provide a valid Contact ID.
  • Select at least one field to update.
  • Double-check field values for correct format.
  • Ensure your API credentials are set up correctly in n8n.

Links and References

Discussion