Mailtrap icon

Mailtrap

Interact with Mailtrap API

Overview

The "Update Contact" operation in this node allows users to modify existing contact information within an email marketing or contact management system. It is useful for scenarios where you need to update a contact's details such as their name, email address, subscription status, or list memberships. For example, you might use this node to correct a contact's email address, add them to new mailing lists, remove them from others, or mark them as unsubscribed.

Properties

Name Meaning
Authentication Method of authentication to access the API: either "API Token" or "Bearer Token".
Account ID The identifier of the account under which the contact exists. Required to specify the target account.
Contact ID or Email The unique identifier or email address of the contact to update.
Email New email address to update for the contact (optional).
Fields (JSON) JSON object containing key-value pairs of fields to update on the contact, e.g., first_name, last_name.
List IDs to Include a Contact Comma-separated list of mailing list IDs to which the contact should be added.
Lists IDs to Exclude a Contact Comma-separated list of mailing list IDs from which the contact should be removed.
Unsubscribed? Boolean flag indicating whether the contact is unsubscribed from emails.

Output

The node outputs JSON data representing the updated contact record after the operation completes. This typically includes the contact's updated fields, current subscription status, and list memberships. If the node supports binary data output, it would relate to any attachments or files associated with the contact, but this is not indicated here.

Dependencies

  • Requires an external API service that manages contacts and mailing lists.
  • Needs proper authentication via either an API token or bearer token.
  • The user must provide valid Account ID and Contact ID or Email.
  • No specific environment variables are mentioned, but API credentials must be configured in n8n.

Troubleshooting

  • Invalid Authentication: Errors may occur if the provided API or bearer token is invalid or expired. Ensure tokens are correctly set up and have necessary permissions.
  • Contact Not Found: If the Contact ID or Email does not exist, the API will likely return an error. Verify the contact identifier is correct.
  • Malformed JSON in Fields: The "Fields (JSON)" property must be valid JSON. Invalid JSON syntax will cause errors.
  • List IDs Format: List IDs must be comma-separated numbers without extra characters. Incorrect formatting can lead to failure in updating list memberships.
  • Unsubscribed Flag Conflicts: Setting the unsubscribed flag incorrectly may affect email delivery; confirm intended subscription status before updating.

Links and References

  • Refer to your email marketing platform’s API documentation for details on contact update endpoints.
  • JSON validation tools can help ensure the "Fields (JSON)" input is correctly formatted.
  • n8n documentation on setting up API credentials and using HTTP request nodes may be helpful for troubleshooting authentication issues.

Discussion