Magnet Customer icon

Magnet Customer

Consume Magnet Customer API

Overview

This node integrates with the Magnet Customer API to manage leads, specifically supporting operations such as deleting a lead. The "Delete Lead" operation allows users to remove a lead from their Magnet Customer database by specifying its unique ID. This is useful in scenarios where leads are no longer relevant, have been converted, or need to be cleaned up to maintain data accuracy.

Practical examples include:

  • Automatically deleting leads that have unsubscribed or opted out.
  • Removing duplicate or test leads after import.
  • Cleaning up leads after a sales process is completed or abandoned.

Properties

Name Meaning
Authentication Method of authentication to use: either "API Token" or "OAuth2".
Contact ID The unique identifier (ID) of the lead to delete. This is required to specify which lead to remove.
Life Cycle Hidden property indicating the life cycle stage of the contact; for this operation, it defaults to "lead".
Source Hidden property indicating the source of the contact; defaults to "n8n".

Note: The "Life Cycle" and "Source" properties are hidden and preset internally to ensure correct API behavior but do not require user input.

Output

The output of the node is a JSON array containing the response from the Magnet Customer API after attempting to delete the specified lead. Typically, this will include confirmation of deletion or an error message if the operation failed.

The json output field structure generally includes:

  • Confirmation details about the deleted lead.
  • Any error messages if the deletion was unsuccessful.

This node does not output binary data.

Dependencies

  • Requires access to the Magnet Customer API.
  • Requires configuration of credentials in n8n, either via an API token or OAuth2 authentication.
  • The node uses internal helper functions to make authenticated HTTP requests to the Magnet Customer API endpoints.

Troubleshooting

  • Common Issues:

    • Invalid or missing Lead ID: The node requires a valid lead ID to delete. Ensure the ID is correct and exists in the system.
    • Authentication errors: If the API token or OAuth2 credentials are invalid or expired, the request will fail.
    • Permission issues: The API user must have sufficient permissions to delete leads.
  • Error Messages:

    • "error": "Lead not found": The specified lead ID does not exist. Verify the ID.
    • "error": "Unauthorized" or "Authentication failed": Check your API credentials and re-authenticate if necessary.
    • Network or timeout errors: Ensure the Magnet Customer API service is reachable and stable.
  • Resolution Tips:

    • Double-check the lead ID input.
    • Reconfigure or refresh API credentials.
    • Review API user permissions.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch operations.

Links and References


If you need further details on other operations or resources, feel free to ask!

Discussion