Skip to main content

Email Variants

Variants allow you to A/B test different email approaches. Each variant has its own subject line, content, and distribution percentage.

Creating Variants

Add variants when updating a campaign:
requests.put(
    f"{base_url}/api/public/v1/campaigns/{campaign_id}",
    headers={"X-API-Key": api_key},
    json={
        "variants": [
            {
                "variant_name": "A",
                "variant_label": "Direct Approach",
                "subject_template": "Quick question about {{company}}",
                "email_content": "Hi {{first_name}},\n\nI wanted to reach out about...\n\nBest,\nJohn",
                "distribution_percent": 50
            },
            {
                "variant_name": "B",
                "variant_label": "Soft Introduction",
                "subject_template": "Introduction - {{company}}",
                "email_content": "Hi {{first_name}},\n\nI hope this finds you well...\n\nBest,\nJohn",
                "distribution_percent": 50
            }
        ]
    }
)

Variant Fields

FieldTypeRequiredDescription
variant_namestringNoIdentifier (A, B, C), default: “A”
variant_labelstringNoUser-friendly label
subject_templatestringYesEmail subject line (1-500 characters)
email_contentstringYesEmail body (10-100,000 characters)
distribution_percentintegerNoDistribution weight (default: 100)

Distribution Rules

Distribution percentages determine how leads are allocated to variants:
  • All variant distributions must sum to exactly 100%
  • Leads are randomly assigned to variants based on distribution
  • Assignment happens when the campaign launches

Example Distributions

Single Variant:
{"variants": [{"variant_name": "A", "distribution_percent": 100, ...}]}
Two-Way Split:
{"variants": [
  {"variant_name": "A", "distribution_percent": 50, ...},
  {"variant_name": "B", "distribution_percent": 50, ...}
]}
Three-Way Split:
{"variants": [
  {"variant_name": "A", "distribution_percent": 50, ...},
  {"variant_name": "B", "distribution_percent": 30, ...},
  {"variant_name": "C", "distribution_percent": 20, ...}
]}

Limits

  • Maximum 4 variants per campaign
  • Variant names must be unique within a campaign
  • Variant names are converted to uppercase

Subject Lines

Subject lines support personalization variables:
{
  "subject_template": "Quick question for {{first_name}} at {{company}}"
}
Keep subject lines concise:
  • Recommended length: 40-60 characters
  • Maximum: 500 characters
  • Avoid all caps and excessive punctuation

Email Content

Email body supports both plain text and personalization:
{
  "email_content": "Hi {{first_name}},\n\nI noticed {{company}} is hiring. I wanted to share how we've helped similar companies like {{company}} scale their outreach.\n\nWould you be open to a brief call?\n\nBest,\nJohn Smith"
}

Formatting

Emails are sent as plain text by default. Include line breaks with \n:
{
  "email_content": "Hi {{first_name}},\n\nParagraph one.\n\nParagraph two.\n\nBest,\nJohn"
}

Personalization

Use variables to personalize content:
Hi {{first_name}},

I'm reaching out because {{company}} seems like a great fit for...

{{#if industry}}
I noticed you're in the {{industry}} industry, where we've helped companies like...
{{/if}}

Best,
John
See Personalization for complete documentation.

Validation Errors

Distribution Mismatch

{
  "detail": "Variant distributions must sum to 100%, got 90%"
}

Duplicate Variant Name

{
  "detail": "Duplicate variant name: A"
}

Missing Required Field

{
  "detail": [
    {
      "loc": ["body", "variants", 0, "subject_template"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}