Learn how to create, configure, and optimize email campaigns — from sequences and A/B testing to scheduling, email account rotation, and advanced settings
A SmartLead campaign is the core unit of outbound email. It ties together your email accounts, sequences, leads, and sending schedule into a single automated workflow. This guide covers everything you need to configure a campaign programmatically.
Use descriptive campaign names that include the quarter, ICP, and persona. This makes it easier to filter and compare performance later. Example: Q1 SaaS Outreach — VP Sales — US.
sequences_payload = { "sequences": [ { "seq_number": 1, "subject": "Quick question about {{company_name}}", "email_body": """Hi {{first_name}},I noticed {{company_name}} is scaling its outbound — are you exploring ways to improve reply rates?We help {{industry}} companies like yours book 3x more meetings through automated cold email.Worth a 15-minute call this week?Best,Sarah""", "seq_delay_details": {"delay_in_days": 0} }, { "seq_number": 2, "subject": "Re: Quick question about {{company_name}}", "email_body": """Hi {{first_name}},Following up — I wanted to share a case study from a {{industry}} company that went from 2% to 14% reply rates in 30 days.Happy to walk through what they did if you have 10 minutes.Sarah""", "seq_delay_details": {"delay_in_days": 3} }, { "seq_number": 3, "subject": "Re: Quick question about {{company_name}}", "email_body": """Hi {{first_name}},Don't want to be a pest — just checking if improving outbound pipeline is a priority for {{company_name}} right now.If the timing isn't right, no worries. Happy to reconnect next quarter.Best,Sarah""", "seq_delay_details": {"delay_in_days": 5} } ]}response = requests.post( f"{BASE_URL}/campaigns/{campaign_id}/sequences", params={"api_key": API_KEY}, json=sequences_payload)print("Sequences created!")
Use double curly braces to insert lead-specific data into your emails:
Variable
Description
Source
{{first_name}}
Lead’s first name
Lead import
{{last_name}}
Lead’s last name
Lead import
{{email}}
Lead’s email address
Lead import
{{company_name}}
Company name
Lead import
{{location}}
Lead’s location
Lead import
{{custom_field_name}}
Any custom field
custom_fields on import
If a personalization variable is missing for a lead, SmartLead will leave the placeholder blank. Use fallback values in your copy to handle this gracefully — for example, write “your team” as a fallback for {{company_name}}.
Test different subject lines or email bodies to optimize performance:
Python
Copy
Ask AI
sequences_with_variants = { "sequences": [ { "seq_number": 1, "subject": "Quick question about {{company_name}}", "email_body": "Hi {{first_name}},\n\nI noticed {{company_name}} is scaling...", "seq_delay_details": {"delay_in_days": 0}, "variants": [ { "subject": "{{first_name}}, quick thought on {{company_name}}", "email_body": "Hey {{first_name}},\n\nSaw that {{company_name}} is growing fast...", "variant_distribution": 50 } ] } ]}response = requests.post( f"{BASE_URL}/campaigns/{campaign_id}/sequences", params={"api_key": API_KEY}, json=sequences_with_variants)
SmartLead automatically splits traffic between variants and tracks open/reply rates for each.
Test one variable at a time (subject line OR body, not both) so you can isolate what drives performance. Run tests for at least 200 sends before drawing conclusions.
# List all email accountsresponse = requests.get( f"{BASE_URL}/email-accounts", params={"api_key": API_KEY})accounts = response.json()for account in accounts: print(f"ID: {account['id']} | {account['from_email']} | Warmup: {account['warmup_enabled']}")
Only link accounts that have been warmed up for at least 14 days. Sending cold emails from a fresh account will hurt your deliverability and sender reputation. See the Email Warmup Guide for details.
Check these in order: (1) Email accounts are linked and warmed up, (2) the schedule window includes the current day and time, (3) leads have been imported and are in “Not Contacted” status, (4) email accounts haven’t hit their daily sending limit.
High bounce rates
Verify your lead list quality. Use an email verification service before importing leads. Check that your email accounts’ DNS records (SPF, DKIM, DMARC) are properly configured. Consider reducing your daily sending volume.
Low open rates
Test different subject lines with A/B testing. Check your sender reputation using tools like mail-tester.com. Ensure your email accounts are properly warmed up. Avoid spam trigger words in subject lines.
Sequences not advancing to the next step
Verify that the delay days are set correctly between steps. Check if stop_on_reply or other stop conditions are triggering. Ensure the campaign status is still ACTIVE.