Smartlead icon

Smartlead

Interact with the Smartlead.ai API

Overview

This node interacts with the Smartlead.ai API to fetch detailed statistics for a specific campaign. The "Get By Campaign" operation under the "Campaign Statistic" resource retrieves email engagement statistics such as opens, clicks, and replies filtered by sequence number and status. This is useful for marketing teams or sales automation workflows that want to analyze how recipients are interacting with their email campaigns.

Practical examples include:

  • Retrieving the number of opened emails in the first sequence step of a campaign.
  • Fetching click or reply statistics for a particular campaign to measure engagement.
  • Paginating through large sets of campaign statistics to process or visualize data externally.

Properties

Name Meaning
Campaign ID The unique identifier of the campaign for which statistics are being fetched (required).
Additional Options A collection of optional filters and pagination controls:
- Limit Maximum number of results to return (default 50).
- Offset Starting index for pagination (default 0).
- Email Sequence Number Filter statistics by the email sequence step number (e.g., 1, 2).
- Email Status Filter by email engagement status; options are "Opened", "Clicked", or "Replied" (default "Opened").

Output

The node outputs a JSON array where each item represents a statistical record related to the specified campaign. Each record includes details about email sequences and engagement statuses according to the applied filters.

The output structure corresponds directly to the API response from the endpoint /campaigns/{campaignId}/statistics and typically contains fields such as counts of opened, clicked, or replied emails per sequence number.

No binary data output is produced by this operation.

Dependencies

  • Requires an active API key credential for authenticating requests to the Smartlead.ai API.
  • The base URL used for API calls is https://server.smartlead.ai/api/v1.
  • Proper configuration of the API authentication credential within n8n is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing Campaign ID will cause the API call to fail.
    • Incorrect API credentials or expired tokens will result in authentication errors.
    • Requesting a limit or offset beyond available data may return empty results.
    • Using unsupported email status values will cause the API to reject the request.
  • Error messages:

    • Authentication errors typically indicate invalid API keys; verify and update credentials.
    • "Not Found" errors usually mean the Campaign ID does not exist or is inaccessible.
    • Validation errors may occur if required parameters are missing or incorrectly formatted.

To resolve these, ensure all required parameters are correctly set, credentials are valid, and the campaign exists in the Smartlead system.

Links and References

Discussion