Skip to main content
GET
/
api
/
v1
/
campaigns
/
{campaign_id}
/
leads
# Get replied leads
curl "https://server.smartlead.ai/api/v1/campaigns/123/leads?api_key=YOUR_KEY&emailStatus=is_replied&limit=100"
{
  "total": 150,
  "leads": [
    {
      "id": 789,
      "email": "john@company.com",
      "first_name": "John",
      "last_name": "Doe",
      "company_name": "ACME Corp",
      "status": "INPROGRESS",
      "category_id": 1,
      "category_name": "Interested",
      "created_at": "2025-01-15T10:00:00Z",
      "last_sent_time": "2025-01-20T09:00:00Z",
      "email_stats": {
        "is_opened": true,
        "is_clicked": true,
        "is_replied": true,
        "is_bounced": false
      },
      "custom_fields": {
        "job_title": "CEO",
        "industry": "SaaS"
      }
    }
  ],
  "offset": 0,
  "limit": 100
}
Fetch all leads in a campaign with advanced filtering by status, category, engagement, and date ranges. Essential for lead management, reporting, and analysis.

Overview

Retrieves all leads associated with a campaign with comprehensive filtering options similar to Master Inbox endpoints. Key Features:
  • Pagination support (offset/limit, max 100 per request)
  • Filter by lead status (STARTED, INPROGRESS, COMPLETED, PAUSED, STOPPED)
  • Filter by email engagement (opened, clicked, replied, bounced, etc.)
  • Filter by lead category
  • Date range filtering (created_at, last_sent_time, event_time)

Path Parameters

campaign_id
number
required
Campaign ID

Query Parameters

api_key
string
required
Your SmartLead API key
offset
number
default:"0"
Pagination offset (minimum 0)
limit
number
default:"100"
Records per page (minimum 1, maximum 100)
created_at_gt
string
Filter leads created after this date (ISO 8601 format)
last_sent_time_gt
string
Filter leads with last email sent after this date (ISO 8601 format)
event_time_gt
string
Filter by last event time (ISO 8601 format)
status
string
Lead status filterValid values:
  • STARTED - Lead added, sequence not started
  • INPROGRESS - Currently in sequence
  • COMPLETED - Sequence completed
  • PAUSED - Lead paused
  • STOPPED - Lead stopped
lead_category_id
number
Filter by specific category ID
emailStatus
string
Filter by email engagement statusValid values:
  • is_opened - Email was opened
  • is_clicked - Link was clicked
  • is_bounced - Email bounced
  • is_replied - Lead replied
  • is_unsubscribed - Lead unsubscribed
  • is_spam - Marked as spam
  • is_accepted - Email accepted by server
  • not_replied - Opened but didn’t reply
  • is_sender_bounced - Sender bounce
# Get replied leads
curl "https://server.smartlead.ai/api/v1/campaigns/123/leads?api_key=YOUR_KEY&emailStatus=is_replied&limit=100"

Response Example

{
  "total": 150,
  "leads": [
    {
      "id": 789,
      "email": "john@company.com",
      "first_name": "John",
      "last_name": "Doe",
      "company_name": "ACME Corp",
      "status": "INPROGRESS",
      "category_id": 1,
      "category_name": "Interested",
      "created_at": "2025-01-15T10:00:00Z",
      "last_sent_time": "2025-01-20T09:00:00Z",
      "email_stats": {
        "is_opened": true,
        "is_clicked": true,
        "is_replied": true,
        "is_bounced": false
      },
      "custom_fields": {
        "job_title": "CEO",
        "industry": "SaaS"
      }
    }
  ],
  "offset": 0,
  "limit": 100
}

Common Workflows

Export Interested Leads

# Get all interested leads
interested = get_leads(
    campaign_id=123,
    filters={"lead_category_id": 1}
)

# Export to CSV
import csv
with open('interested_leads.csv', 'w') as f:
    writer = csv.DictWriter(f, fieldnames=['email', 'name', 'company'])
    for lead in interested['leads']:
        writer.writerow({
            'email': lead['email'],
            'name': f"{lead['first_name']} {lead['last_name']}",
            'company': lead.get('company_name', '')
        })