Magnet Customer icon

Magnet Customer

Consume Magnet Customer API

Overview

This node integrates with the Magnet Customer API to create a new Lead contact in the system. It is designed to facilitate adding detailed lead information such as personal details, contact info, and custom fields into the CRM. This node is beneficial for automating lead generation workflows, syncing lead data from other sources, or bulk importing leads.

Practical examples include:

  • Automatically creating leads from form submissions on a website.
  • Importing lead lists from external marketing platforms.
  • Enriching lead data by adding custom fields and multiple phone numbers programmatically.

Properties

Name Meaning
Authentication Method of authentication: "API Token" or "OAuth2".
Fullname The full name of the lead contact (required).
E-Mail The email address of the lead contact.
Phones Collection of phone numbers associated with the lead. Can add multiple phone entries.
Gender Gender of the lead contact. Options: "Male" (M), "Woman" (F).
Birthdate The birthdate of the lead contact.
Work The occupation or work description of the lead.
Marital Status Marital status of the lead contact.
Document (CPF/CNPJ) Identification document number of the lead (Brazilian CPF or CNPJ).
Legal Type Legal classification of the lead: "Physical" or "Legal".
State State where the lead resides.
City City where the lead resides.
Address Street address of the lead.
Address Number Number portion of the street address.
Complement Address Additional address information (e.g., apartment, suite).
Neighborhood Neighborhood of the lead's address.
CEP Postal code (Brazilian postal code format).
Owners Owners associated with the lead contact.
Custom Fields Collection of custom fields to set additional properties not predefined. Each includes a field ID/name and value.
Life Cycle Hidden property indicating the life cycle stage; default is "prospect".
Source Hidden property indicating the source of the contact; default is "n8n".

Output

The node outputs JSON data representing the newly created lead object as returned by the Magnet Customer API. This typically includes all the lead's properties, IDs, timestamps, and any server-generated metadata.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the Magnet Customer API.
  • Requires either an API token or OAuth2 credentials configured in n8n for authentication.
  • The node depends on internal helper functions to make HTTP requests to the API endpoints.
  • No additional environment variables are explicitly required beyond the API credentials.

Troubleshooting

  • Authentication errors: Ensure that the API token or OAuth2 credentials are valid and have sufficient permissions to create leads.
  • Validation errors: Required fields like "Fullname" must be provided; missing these will cause the API to reject the request.
  • Custom fields issues: When setting custom fields, ensure the field IDs/names exist and values conform to expected formats.
  • Network errors: Check connectivity to the Magnet Customer API endpoint.
  • Error messages: If the node throws errors containing error.message, review the message for clues such as invalid parameters or permission issues. Use the "Continue On Fail" option to handle errors gracefully during batch operations.

Links and References

Discussion