Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.foxreach.io/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through setting up a complete cold email campaign using the API — from creating the campaign to sending your first emails.

Overview

A campaign consists of five parts that need to be configured in order:
1

Create the campaign

Define name, timezone, sending schedule, and daily limits.
2

Add sequence steps

Create the email chain — initial outreach, follow-ups, and final touches.
3

Add leads

Assign leads (contacts) to the campaign.
4

Assign email accounts

Choose which email accounts will send the campaign emails.
5

Start the campaign

Transition the campaign from draft to active — emails begin sending.

Step 1: Create a Campaign

Create a new campaign in draft status. It won’t send anything until you start it.
curl -X POST "https://api.foxreach.io/api/v1/campaigns" \
  -H "X-API-Key: otr_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q1 Enterprise Outreach",
    "timezone": "America/New_York",
    "sendingDays": [1, 2, 3, 4, 5],
    "sendingStartHour": 9,
    "sendingEndHour": 17,
    "dailyLimit": 50
  }'
Save the campaign.id — you’ll need it for all subsequent steps.

Step 2: Add Sequence Steps

Sequences define the emails in your campaign. Each step has a subject, body, and delay (days to wait after the previous step).
from foxreach import SequenceCreate

# Step 1: Initial outreach (sent immediately)
step1 = client.campaigns.sequences.create(campaign.id, SequenceCreate(
    subject="Quick question about {{company}}",
    body="Hi {{firstName}},\n\nI noticed {{company}} is growing fast. We help companies like yours with cold email outreach.\n\nWould you be open to a quick chat this week?\n\nBest,\n[Your Name]",
    delay_days=0,
))

# Step 2: Follow-up (3 days later)
step2 = client.campaigns.sequences.create(campaign.id, SequenceCreate(
    subject="Re: Quick question about {{company}}",
    body="Hi {{firstName}},\n\nJust following up on my last email. I know you're busy — would a 15-minute call work better?\n\nHere's a link to book time: [calendar link]\n\nCheers,\n[Your Name]",
    delay_days=3,
))

# Step 3: Final touch (5 days later)
step3 = client.campaigns.sequences.create(campaign.id, SequenceCreate(
    subject="Last try — {{firstName}}",
    body="Hi {{firstName}},\n\n{I understand if this isn't a priority right now|No worries if the timing isn't right}. I'll leave the door open — feel free to reach out anytime.\n\nBest,\n[Your Name]",
    delay_days=5,
))

print(f"Added 3 sequence steps")
Use template variables like {{firstName}} and {{company}} for personalization. Use spin syntax like {option1|option2} for unique variations that improve deliverability.

Step 3: Add Leads

Add leads to the campaign by their IDs. If you haven’t created leads yet, do that first using the Leads API.
lead_ids = ["cld_lead1", "cld_lead2", "cld_lead3"]
result = client.campaigns.add_leads(campaign.id, lead_ids)
print(f"Added {len(lead_ids)} leads to campaign")
Leads that are already enrolled in the campaign will be skipped (no duplicates).

Step 4: Assign Email Accounts

Assign one or more email accounts to send the campaign emails. The campaign will rotate between assigned accounts.
account_ids = ["acc_sender1"]
result = client.campaigns.add_accounts(campaign.id, account_ids)
print(f"Assigned {len(account_ids)} email account(s)")
Use client.email_accounts.list() (Python) or client.emailAccounts.list() (TypeScript) to see your available accounts and their health scores.

Step 5: Start the Campaign

Once everything is configured, start the campaign. Emails will begin sending according to the schedule and daily limits.
campaign = client.campaigns.start(campaign.id)
print(f"Campaign started! Status: {campaign.status}")

client.close()
Make sure your sequence steps, leads, and email accounts are all configured before starting. You can’t edit an active campaign — pause it first.

Monitoring Performance

After your campaign is running, check its performance:
stats = client.analytics.campaign(campaign.id)
print(f"Sent: {stats.sent}")
print(f"Delivered: {stats.delivered}")
print(f"Replied: {stats.replied}")
print(f"Reply rate: {stats.reply_rate:.1f}%")
print(f"Bounce rate: {stats.bounce_rate:.1f}%")

Next Steps

Template Variables

Learn about personalization variables and spin syntax for better deliverability.

Inbox Management

Monitor and categorize replies from your campaign.

Webhooks

Get real-time notifications when emails are sent, replies come in, or campaigns complete.

Analytics

View dashboard-level KPIs across all your campaigns.