This guide walks you through everything you need to go from zero to a live email campaign using the SmartLead API. By the end, you’ll have created a campaign, added email accounts, imported leads, configured sequences, and started sending — all through code.
Navigate to Settings → API Keys from the left sidebar.
3
Generate a Key
Click Generate New API Key, give it a descriptive name (e.g., “Production API” or “Dev Testing”), and copy the key immediately.
Your API key is shown only once. Store it in a secure location like an environment variable or secrets manager. Never hardcode it in source files or commit it to version control.
For best deliverability, warm up new email accounts for at least 14 days before adding them to active campaigns. See the Email Warmup Guide for details.
sequences_payload = { "sequences": [ { "seq_number": 1, "subject": "Quick question about {{company_name}}", "email_body": """Hi {{first_name}},I came across {{company_name}} and noticed you're in the {{industry}} space.We help companies like yours increase outbound pipeline by 3x through automated cold email. Companies like [relevant reference] saw results within the first month.Would it make sense to chat for 15 minutes 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 on my note — I wanted to share a quick case study that might be relevant.[Case study company] in {{industry}} increased their reply rates from 2% to 12% after switching to our approach.Worth a quick call?Sarah""", "seq_delay_details": {"delay_in_days": 3} }, { "seq_number": 3, "subject": "Re: Quick question about {{company_name}}", "email_body": """Hi {{first_name}},I don't want to be a pest — just wanted to check if this is something {{company_name}} is thinking about right now.If the timing isn't right, no worries at all. Happy to reconnect later.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!")