Mailtrap icon

Mailtrap

Interact with Mailtrap API

Overview

This node allows users to create a new contact in an external email or marketing platform. It is useful for automating the addition of contacts to mailing lists or customer databases, especially when integrating with other workflows that collect user information or generate leads.

Typical use cases include:

  • Adding new subscribers collected from web forms into a contact list.
  • Automating contact creation during onboarding processes.
  • Syncing contacts from other systems into a centralized marketing platform.

For example, after capturing a user's email and name via a form, this node can create a contact record with those details and assign the contact to specific mailing lists.

Properties

Name Meaning
Authentication Method used to authenticate API requests. Options: "API Token" or "Bearer Token".
Account ID The identifier of the account under which the contact will be created.
Email The email address of the contact to be created.
Fields (JSON) Additional contact fields provided as a JSON object, e.g., first name, last name, etc.
List IDs Comma-separated list of mailing list IDs to which the contact should be added.

Output

The node outputs JSON data representing the newly created contact. This typically includes the contact's unique ID, email, assigned lists, and any additional fields returned by the external service.

If the node supports binary data output (not indicated here), it would represent attachments or files related to the contact, but this node focuses on JSON contact data only.

Dependencies

  • Requires an API key or bearer token for authentication with the external service.
  • Needs the Account ID to specify the target account context.
  • The node depends on the external platform's API to create contacts and assign them to lists.

No special environment variables are indicated beyond standard API credentials.

Troubleshooting

  • Invalid Authentication: Errors may occur if the API token or bearer token is incorrect or expired. Verify credentials and update them if necessary.
  • Missing Required Fields: Ensure that the Account ID and Email fields are provided; otherwise, the API will reject the request.
  • Malformed JSON in Fields: The "Fields (JSON)" input must be valid JSON. Invalid syntax will cause parsing errors.
  • Incorrect List IDs Format: List IDs should be comma-separated numbers without extra characters. Improper formatting may lead to failure in assigning lists.

Links and References

  • Refer to the external platform’s API documentation for detailed information on contact creation endpoints and required fields.
  • Consult n8n documentation on how to configure API authentication credentials.

Discussion