# SmartLead

> Integrate with SmartLead to manage email outreach campaigns and leads with comprehensive analytics and performance tracking.

Source: https://cotera.co/docs/reference/tools/individual-tools/smartlead

---

**Authentication Type:** API Key\
**Description:** Integrate with SmartLead to manage email outreach campaigns and leads with comprehensive analytics and performance tracking.

***

## Authentication

To authenticate, you'll need a SmartLead API key. Learn how to get one in the [SmartLead API documentation](https://helpcenter.smartlead.ai/en/articles/125-full-api-documentation).

***

## Campaigns

Operations for SmartLead campaigns with analytics and performance tracking.

### List All Campaigns

Retrieves a list of all campaigns in your SmartLead account.

**Operation Type:** Query (Read)

**Parameters:**

* None

**Returns:**

* **campaigns** `array of objects`: Array of campaign objects
  * **id** `number`: Campaign ID
  * **user\_id** `number`: User ID who created the campaign
  * **created\_at** `string`: Campaign creation timestamp
  * **updated\_at** `string`: Campaign last update timestamp
  * **status** `enum`: Campaign status (DRAFTED, ACTIVE, COMPLETED, STOPPED, PAUSED)
  * **name** `string`: Campaign name
  * **track\_settings** `array of enums`: Tracking settings for the campaign
  * **min\_time\_btwn\_emails** `number`: Minimum time between emails in minutes
  * **max\_leads\_per\_day** `number`: Maximum leads per day
  * **parent\_campaign\_id** `number` (nullable): Parent campaign ID if this is a child campaign
  * **client\_id** `number` (nullable): Client ID if attached to a client

**Example Usage:**

```json
{}
```

### Get Campaign Statistics

Fetches detailed statistics for a specific campaign including lead interactions, email status, and engagement metrics.

**Operation Type:** Query (Read)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **offset** `number` (nullable): Pagination offset
* **limit** `number` (nullable): Pagination limit
* **emailSequenceNumber** `number` (nullable): Email sequence number filter
* **emailStatus** `string` (nullable): Email status filter (opened | clicked | replied | unsubscribed | bounced)

**Returns:**

* **total\_stats** `string`: Total statistics count
* **data** `array of objects`: Array of campaign statistics
  * **lead\_name** `string` (nullable): Lead name
  * **lead\_email** `string`: Lead email address
  * **lead\_category** `string` (nullable): Lead category
  * **sequence\_number** `number`: Email sequence number
  * **email\_subject** `string`: Email subject line
  * **email\_message** `string`: Email message content
  * **sent\_time** `string` (nullable): Email sent timestamp
  * **open\_time** `string` (nullable): Email open timestamp
  * **click\_time** `string` (nullable): Email click timestamp
  * **reply\_time** `string` (nullable): Email reply timestamp
  * **open\_count** `number`: Number of times email was opened
  * **click\_count** `number`: Number of times email was clicked
  * **is\_unsubscribed** `boolean`: Whether lead is unsubscribed
  * **is\_bounced** `boolean`: Whether email bounced
* **offset** `number`: Pagination offset
* **limit** `number`: Pagination limit

**Example Usage:**

```json
{
  "campaignId": 12345,
  "offset": 0,
  "limit": 100,
  "emailSequenceNumber": 1,
  "emailStatus": "opened"
}
```

### Get Campaign Analytics by Date Range

Retrieves campaign analytics for a specific date range (max 30 days). Provides counts for sent, opened, clicked, replied, bounced, and unsubscribed emails.

**Operation Type:** Query (Read)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **startDate** `string` (required): Start date in YYYY-MM-DD format
* **endDate** `string` (required): End date in YYYY-MM-DD format

**Returns:**

* **id** `number`: Campaign ID
* **user\_id** `number`: User ID
* **created\_at** `string`: Campaign creation timestamp
* **status** `string`: Campaign status
* **name** `string`: Campaign name
* **start\_date** `string`: Analytics start date
* **end\_date** `string`: Analytics end date
* **sent\_count** `string`: Number of emails sent
* **open\_count** `string`: Number of emails opened
* **click\_count** `string`: Number of emails clicked
* **reply\_count** `string`: Number of replies received
* **block\_count** `string`: Number of blocks
* **bounce\_count** `string`: Number of bounced emails
* **unsubscribed\_count** `string`: Number of unsubscribed leads

**Example Usage:**

```json
{
  "campaignId": 12345,
  "startDate": "2024-12-01",
  "endDate": "2024-12-31"
}
```

### Get Campaign Top-Level Analytics

Fetches comprehensive campaign analytics including overall performance metrics, lead statistics, tags, and client information.

**Operation Type:** Query (Read)

**Parameters:**

* **campaignId** `number` (required): The campaign ID

**Returns:**

* **id** `number`: Campaign ID
* **user\_id** `number`: User ID
* **created\_at** `string`: Campaign creation timestamp
* **status** `string`: Campaign status
* **name** `string`: Campaign name
* **sent\_count** `string`: Number of emails sent
* **open\_count** `string`: Number of emails opened
* **click\_count** `string`: Number of emails clicked
* **reply\_count** `string`: Number of replies received
* **bounce\_count** `string`: Number of bounced emails
* **unsubscribed\_count** `string`: Number of unsubscribed leads
* **sequence\_count** `string`: Number of sequences
* **unique\_open\_count** `string`: Unique opens count
* **unique\_click\_count** `string`: Unique clicks count
* **unique\_sent\_count** `string`: Unique sent count
* **client\_id** `number` (nullable): Client ID
* **client\_name** `string` (nullable): Client name
* **client\_email** `string` (nullable): Client email
* **parent\_campaign\_id** `number` (nullable): Parent campaign ID
* **tags** `array of objects` (nullable): Campaign tags
  * **id** `number`: Tag ID
  * **name** `string`: Tag name
  * **color** `string`: Tag color
* **campaign\_lead\_stats** `object`: Campaign lead statistics
  * **total** `number`: Total leads
  * **blocked** `number`: Blocked leads
  * **stopped** `number`: Stopped leads
  * **completed** `number`: Completed leads
  * **inprogress** `number`: In progress leads
  * **notStarted** `number`: Not started leads

**Example Usage:**

```json
{
  "campaignId": 12345
}
```

### Create Campaign

Creates a new SmartLead campaign with the specified name. Optionally associate it with a client.

**Operation Type:** Mutation (Write)

**Parameters:**

* **name** `string` (required): Name of the campaign
* **clientId** `number` (nullable): Client ID to associate with the campaign (optional)

**Returns:**

* **id** `number`: The created campaign ID
* **name** `string`: The campaign name
* **created\_at** `string`: Campaign creation timestamp

**Example Usage:**

```json
{
  "name": "Q1 2025 Outreach Campaign",
  "clientId": 456
}
```

### Add Sequence to Campaign

Adds email sequences to a campaign. Each sequence can have multiple variants for A/B testing with customizable delays.

**Operation Type:** Mutation (Write)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **sequences** `array of objects` (required): Array of sequences to add to the campaign
  * **seqNumber** `number` (required): Sequence number (order in campaign, starting from 1)
  * **seqDelayDays** `number` (required): Days to wait before sending this sequence
  * **variants** `array of objects` (required): Email variants for A/B testing (provide 1-3 variants)
    * **subject** `string` (required): Email subject line
    * **email\_body** `string` (required): Email body content (HTML supported)

**Returns:**

* **sequences** `array of objects`: Array of created sequences
  * **id** `number`: The sequence ID
  * **seq\_number** `number`: The sequence number (order in campaign)
  * **seq\_delay\_details** `object`: Delay configuration
    * **delay\_in\_days** `number`: Days delay before sending

**Example Usage:**

```json
{
  "campaignId": 12345,
  "sequences": [
    {
      "seqNumber": 1,
      "seqDelayDays": 0,
      "variants": [
        {
          "subject": "Quick question about {{companyName}}",
          "email_body": "<p>Hi {{firstName}},</p><p>I noticed you work at {{companyName}} and wanted to reach out...</p>"
        },
        {
          "subject": "{{firstName}}, a quick thought",
          "email_body": "<p>Hi {{firstName}},</p><p>I came across your profile and thought you might be interested...</p>"
        }
      ]
    },
    {
      "seqNumber": 2,
      "seqDelayDays": 3,
      "variants": [
        {
          "subject": "Following up",
          "email_body": "<p>Hi {{firstName}},</p><p>Just wanted to follow up on my previous email...</p>"
        }
      ]
    }
  ]
}
```

### Update Campaign Schedule

Updates the sending schedule for a campaign including timezone, active days, hours, and rate limits.

**Operation Type:** Mutation (Write)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **schedule** `object` (required): Schedule configuration
  * **timezone** `string` (required): Timezone (e.g., "America/Los\_Angeles")
  * **days\_of\_the\_week** `array of numbers` (required): Days to send emails (0=Sunday through 6=Saturday)
  * **start\_hour** `string` (required): Start hour in HH:MM format (e.g., "09:00")
  * **end\_hour** `string` (required): End hour in HH:MM format (e.g., "17:00")
  * **min\_time\_btw\_emails** `number` (required): Minimum minutes between emails (default: 5)
  * **max\_new\_leads\_per\_day** `number` (required): Maximum new leads to contact per day

**Returns:**

* **ok** `boolean`: Whether the operation was successful

**Example Usage:**

```json
{
  "campaignId": 12345,
  "schedule": {
    "timezone": "America/New_York",
    "days_of_the_week": [1, 2, 3, 4, 5],
    "start_hour": "09:00",
    "end_hour": "17:00",
    "min_time_btw_emails": 5,
    "max_new_leads_per_day": 50
  }
}
```

### Update Campaign Status

Changes the status of a campaign. Set to ACTIVE to start sending, PAUSED to temporarily stop, or STOPPED to end the campaign.

**Operation Type:** Mutation (Write)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **status** `string` (required): The new status for the campaign. Options: "ACTIVE", "PAUSED", "STOPPED"

**Returns:**

* **ok** `boolean`: Whether the operation was successful

**Example Usage:**

```json
{
  "campaignId": 12345,
  "status": "ACTIVE"
}
```

***

## Leads

Operations for SmartLead leads with comprehensive management capabilities.

### Add Leads to Campaign

Adds leads to a SmartLead campaign with full contact details including name, email, phone, company, location, LinkedIn profile, and custom fields (max 100 leads per request).

**Operation Type:** Mutation (Write)

**Parameters:**

* **campaignId** `number` (required): The campaign ID
* **leadList** `array of objects` (required): Array of lead objects to add to the campaign (max 100 leads)
  * **email** `string` (required): Email address of the lead
  * **firstName** `string` (nullable): First name of the lead
  * **lastName** `string` (nullable): Last name of the lead
  * **phoneNumber** `string` (nullable): Phone number of the lead
  * **companyName** `string` (nullable): Company name of the lead
  * **website** `string` (nullable): Website of the lead
  * **location** `string` (nullable): Location of the lead
  * **customFields** `object` (nullable): Custom fields object (max 20 fields). Keys are field names, values are field values.
  * **linkedinProfile** `string` (nullable): LinkedIn profile URL
  * **companyUrl** `string` (nullable): Company URL
* **settings** `object` (nullable): Optional settings for lead import behavior
  * **ignoreGlobalBlockList** `boolean` (nullable): If true, ignores leads that are part of your global/client level block list
  * **ignoreUnsubscribeList** `boolean` (nullable): If true, ignores leads that have unsubscribed previously
  * **ignoreDuplicateLeadsInOtherCampaign** `boolean` (nullable): If false, allows leads to be added even if they exist in another campaign

**Returns:**

* **ok** `boolean`: Whether the operation was successful
* **upload\_count** `number`: Number of leads uploaded
* **total\_leads** `number`: Total number of leads in the campaign
* **duplicate\_count** `number`: Number of duplicate emails
* **invalid\_email\_count** `number`: Number of invalid formatted emails
* **already\_added\_to\_campaign** `number`: Number of leads already in the campaign
* **unsubscribed\_leads** `array of strings`: Array of unsubscribed email addresses
* **is\_lead\_limit\_exhausted** `boolean`: Whether the lead credit limit has been reached
* **lead\_import\_stopped\_count** `number`: Number of leads that couldn't be imported due to limits

**Example Usage:**

```json
{
  "campaignId": 12345,
  "leadList": [
    {
      "email": "john.doe@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "phoneNumber": "+1-555-123-4567",
      "companyName": "Acme Corp",
      "website": "https://acmecorp.com",
      "location": "San Francisco, CA",
      "linkedinProfile": "https://linkedin.com/in/johndoe",
      "companyUrl": "https://acmecorp.com",
      "customFields": {
        "industry": "Technology",
        "company_size": "50-200"
      }
    },
    {
      "email": "jane.smith@example.com",
      "firstName": "Jane",
      "lastName": "Smith",
      "companyName": "Tech Startup Inc"
    }
  ],
  "settings": {
    "ignoreGlobalBlockList": false,
    "ignoreUnsubscribeList": false,
    "ignoreDuplicateLeadsInOtherCampaign": true
  }
}
```

### Get Lead by Email

Retrieves detailed information about a lead using their email address, including contact details, company information, and subscription status.

**Operation Type:** Query (Read)

**Parameters:**

* **email** `string` (required): Email address to search for

**Returns:**

* **id** `string`: Lead ID
* **first\_name** `string`: Lead first name
* **last\_name** `string`: Lead last name
* **email** `string`: Lead email address
* **created\_at** `string`: Lead creation timestamp
* **phone\_number** `string` (nullable): Lead phone number
* **company\_name** `string` (nullable): Lead company name
* **website** `string` (nullable): Lead website
* **location** `string` (nullable): Lead location
* **custom\_fields** `object`: Custom fields object
* **linkedin\_profile** `string` (nullable): LinkedIn profile URL
* **company\_url** `string` (nullable): Company URL
* **is\_unsubscribed** `boolean`: Whether lead is unsubscribed

**Example Usage:**

```json
{
  "email": "john.doe@example.com"
}
```

### Add to Global Block List

Adds email addresses or domains to the global block list to prevent future outreach. Can be applied globally or to a specific client.

**Operation Type:** Mutation (Write)

**Parameters:**

* **domainBlockList** `array of strings` (required): Array of email addresses or domains to add to global block list
* **clientId** `number` (nullable): Client ID if the block list is client-specific (null for global)

**Returns:**

* **uploadCount** `number`: Number of items successfully added
* **totalDomainAdded** `number`: Total domains/emails added to block list

**Example Usage:**

```json
{
  "domainBlockList": ["spam-domain.com", "badlead@example.com"],
  "clientId": null
}
```

***

## Common Use Cases

**Campaign Management:**

* Monitor campaign performance with detailed statistics and analytics
* Track email engagement metrics across different time periods
* Analyze campaign effectiveness with comprehensive reporting

**Lead Operations:**

* Bulk import leads into campaigns with duplicate detection
* Search for existing leads by email address
* Manage lead lifecycle and subscription status

**Data Quality:**

* Add problematic domains and emails to global block lists
* Track invalid and duplicate email submissions
* Monitor lead import success rates and limitations

