Skip to Content
Won.dev

Create a campaign

Create a sequence of up to six emails for a list of people, and start it. Creating is free; each email sent costs $0.03.

POST https://api.won.dev/v1/email/campaigns

Creates a sequence of up to six emails for a list of people, and with start: true begins sending it. We send from warmed-up mailboxes of our own, a few emails per mailbox per day, in each recipient's office hours; each recipient hears from one mailbox for the whole sequence, and the sequence stops for a person as soon as they answer, bounce or unsubscribe. Creating is free. Sending costs $0.03 for each email handed over; an email that hard-bounces is refunded. A running campaign sets aside the cost of about a week of sending from your balance and pauses, without sending on credit, when the balance runs out. Set dry_run: true first: it checks the texts and the list, shows the first email as the first recipients would get it and what the campaign costs at most, and creates nothing. With an Idempotency-Key header a retry never creates a second campaign. Recipients can also be added later with POST /email/campaigns/{id}/recipients.

  • Billing: The call is free. Each email the campaign sends costs $0.03 (email_sent), see Billing.

Parameters

Parameters go in the JSON body. POST requests also take an Idempotency-Key header, see Sending a request twice.

ParameterTypeRequiredDescription
sender_idstringyesThe sender the emails are for, from POST /email/senders.
namestringyesA name for your own reference. Recipients never see it.
stepsobject[]yesThe emails of the sequence, in order. Two to four work best.
steps[].delay_daysintegernoSending days to wait after the step before. Default 3. Ignored on the first step.
steps[].subjectstringnoThe subject line. Required on the first step. Leave it out on a follow-up to send it as a reply in the thread of the first email, which is what gets answers.
steps[].bodystringyesThe text, as plain text. Placeholders: {{first_name}}, {{last_name}}, {{company}}, your own from variables, and {{sender_first_name}} and {{sender_name}} for the name of the mailbox that writes. {{first_name|there}} falls back to "there". Do not add a signature block with your company and address or an unsubscribe line: every email ends with them.
steps[].weightintegernoWith variants: this version's share of the recipients, relative to the others. Default: 1.
steps[].variantsobject[]noOther versions of this step, to test against it. Each recipient gets one version, always the same one. GET /email/campaigns/{id} shows how each did.
steps[].variants[].subjectstringnoThe subject line. Required on the first step. Leave it out on a follow-up to send it as a reply in the thread of the first email, which is what gets answers.
steps[].variants[].bodystringyesThe text, as plain text. Placeholders: {{first_name}}, {{last_name}}, {{company}}, your own from variables, and {{sender_first_name}} and {{sender_name}} for the name of the mailbox that writes. {{first_name|there}} falls back to "there". Do not add a signature block with your company and address or an unsubscribe line: every email ends with them.
steps[].variants[].weightintegernoWith variants: this version's share of the recipients, relative to the others. Default: 1.
recipientsobject[]noUp to 1000 people to write to. Each is checked: bad addresses, people on a suppression list and people in regions the sender has not declared are left out and listed in the answer.
recipients[].emailstringnoThe person's work email.
recipients[].contact_idstringnoA person ID this account was given in the last 90 days, such as per_8f3k2m9x4p1q, instead of email: from a contact search, a people search, or any endpoint that returns a person. Their email, name, company and country on file are used. A person found without an email needs one first: POST /enrich/people/email/find with person_id.
recipients[].first_namestringnoThe person's first name, for {{first_name}}.
recipients[].last_namestringnoThe person's last name, for {{last_name}}.
recipients[].companystringnoThe company the person works at, for {{company}}.
recipients[].countrystringnoWhere the person is, as an ISO code such as US. It decides their office hours and which rules apply. Guessed from the address when left out. An address that shows a country itself, such as one ending in .de, stays under that country's rules whatever is given here.
recipients[].timezonestringnoThe person's IANA time zone, when you know it better than the country says.
recipients[].variablesobjectnoValues for your own placeholders, such as { "product": "mesh chairs" } for {{product}}. Names are lowercase letters, digits and underscores.
recipients[].metadataobjectnoYour own keys and values, such as {"customer_id": "c_812"}: up to 20 keys of at most 40 characters, each value a string of at most 500. Returned with the recipient, and in the events about them over the campaign's keys of the same name.
scheduleobjectnoWhen emails go out. The hours are read in each recipient's own time zone when their country or time zone is known.
schedule.timezonestringnoIANA time zone the hours are read in for a recipient whose own is not known. Default America/New_York.
schedule.days(sun | mon | tue | wed | thu | fri | sat)[]noDays emails go out on. Default Monday to Friday.
schedule.start_hourintegernoFirst hour emails go out in. Default 9.
schedule.end_hourintegernoEmails go out before this hour. Default 17.
daily_limitintegernoThe most emails the campaign sends on one day. A new account also has a daily limit across its campaigns, which rises as it sends without bounces and complaints. Default: 50.
stop_on_company_replybooleannoWhen one person at a company answers, stop writing to the others at that company. Default: true.
track_opensbooleannoCount opens with an invisible image. Off by default: it lowers inbox placement, and mail programs that fetch images themselves make the numbers unreliable. Default: false.
track_clicksbooleannoCount clicks by sending links through our redirect. Off by default, for the same reason. Default: false.
max_costnumbernoThe most the campaign may spend in its whole life, in US dollars. It pauses when the next email would go over.
metadataobjectnoYour own keys and values, such as {"customer_id": "c_812"}: up to 20 keys of at most 40 characters, each value a string of at most 500. Returned as given, and in the events about it.
startbooleannoStart sending right away. Otherwise the campaign is a draft until POST /email/campaigns/{id}/start. Default: false.
dry_runbooleannoCheck everything and show a preview, without creating anything. Problems in the texts are listed instead of failing the call. Default: false.

Response

With dry_run: true nothing is created or changed: the response has the same fields and says what would happen. Errors are described in Errors.

FieldTypeDescription
dataobjectThe campaign, and what the checks found in its list and its texts.
data.dry_runbooleanTrue when nothing was created: the answer to dry_run: true.
data.campaignobject | nullThe campaign. Null on a dry run: nothing was created.
data.campaign.idstringCampaign ID, such as cmp_7p1q8w3e5r4k2m9x.
data.campaign.namestring
data.campaign.sender_idstring
data.campaign.tenant_idstring | nullIts sender's tenant_id. Null: the account itself.
data.campaign.statusdraft | in_review | active | paused | completed | canceled | suspendeddraft until started. active sends. paused waits for resume. completed, canceled and suspended are final. in_review is no longer given: a campaign left waiting for a review from before starts by itself within minutes.
data.campaign.pause_reasonmanual | insufficient_balance | max_cost | list_quality | sending_suspended | nullWhy it is paused: manual, insufficient_balance (top up, then resume), max_cost (the campaign's own cap is reached), list_quality (too many invalid addresses; resuming accepts the list as it is), sending_suspended.
data.campaign.stepsobject[]The sequence, in order.
data.campaign.steps[].delay_daysintegerSending days to wait after the email before. 0 on the first step.
data.campaign.steps[].versionsobject[]The text of the step. More than one when versions are tested against each other.
data.campaign.steps[].versions[].subjectstring | nullNull on a follow-up that goes out as a reply in the thread of the first email.
data.campaign.steps[].versions[].bodystring
data.campaign.steps[].versions[].weightintegerIts share of the recipients, relative to the other versions.
data.campaign.steps[].versions[].statsobjectHow this version did.
data.campaign.steps[].versions[].stats.sentinteger
data.campaign.steps[].versions[].stats.openedintegerEmails opened at least once. Counted only when track_opens is on.
data.campaign.steps[].versions[].stats.clickedinteger
data.campaign.steps[].versions[].stats.repliedintegerReplies that came after this email and before the next one.
data.campaign.scheduleobjectWhen emails go out: on these days, between these hours, in the recipient's time.
data.campaign.schedule.timezonestringIANA time zone the hours are read in when a recipient's own is not known.
data.campaign.schedule.days(sun | mon | tue | wed | thu | fri | sat)[]
data.campaign.schedule.start_hourinteger
data.campaign.schedule.end_hourinteger
data.campaign.daily_limitintegerThe most emails the campaign sends on one day.
data.campaign.stop_on_company_replybooleanOne person at a company answers: nobody else at that company gets another email.
data.campaign.track_opensboolean
data.campaign.track_clicksboolean
data.campaign.max_costnumber | nullThe most the campaign may spend in its life, in US dollars. Null when not set.
data.campaign.metadataobjectYour own keys and values, as you gave them. Empty when none were.
data.campaign.statsobjectWhere the campaign stands.
data.campaign.stats.recipientsintegerPeople in the campaign.
data.campaign.stats.waitingintegerStill being checked, or waiting for their first email.
data.campaign.stats.in_sequenceintegerGot at least one email and have more to come.
data.campaign.stats.finishedintegerGot every email and did not answer.
data.campaign.stats.repliedinteger
data.campaign.stats.bouncedinteger
data.campaign.stats.unsubscribedinteger
data.campaign.stats.excludedintegerLeft out or stopped: invalid address, suppressed, or stopped by you.
data.campaign.stats.emails_sentinteger
data.campaign.stats.emails_openedinteger
data.campaign.stats.emails_clickedinteger
data.campaign.stats.spentnumberWhat the campaign has cost so far, in US dollars.
data.campaign.stats.reservednumberSet aside from the balance for the emails of the next days, in US dollars.
data.campaign.testbooleanMade with a test key: sending and replies are simulated.
data.campaign.created_atstringWhen it was created, as an ISO 8601 time in UTC.
data.campaign.started_atstring | null
data.campaign.completed_atstring | null
data.recipientsobjectWhat became of the recipients in this request.
data.recipients.acceptedintegerAddresses taken into the campaign.
data.recipients.duplicatesintegerAddresses that were in the campaign already. Nothing changed for them.
data.recipients.rejectedintegerAddresses left out. results says why for each.
data.recipients.resultsobject[]One entry for each address that was rejected, was a duplicate, or was accepted with a warning. Addresses accepted without remark are only counted.
data.recipients.results[].emailstring | null
data.recipients.results[].statusaccepted | duplicate | rejected
data.recipients.results[].recipient_idstring | null
data.recipients.results[].reasonstring | nullWhy it was rejected: invalid_address, blocked_mailbox, duplicate_in_request, suppressed, complained, undeliverable, active_in_other_campaign, region_blocked, region_not_declared, personal_mailbox_in_region, missing_variable, contact_not_found or campaign_full.
data.recipients.results[].messagestring | nullThe same in a sentence, with what to do about it.
data.recipients.results[].warningsstring[]For an accepted address: shared_mailbox (such as info@, read by whoever is on duty) or personal_mailbox (a private mail service).
data.contentobjectWhat the checks found in the texts.
data.content.problemsobject[]What must be fixed. Only a dry run lists them; a real call fails with content_rejected.
data.content.problems[].stepintegerThe step, counted from 1.
data.content.problems[].versionintegerThe version of the step, counted from 1.
data.content.problems[].fieldsubject | body
data.content.problems[].codestring
data.content.problems[].messagestring
data.content.adviceobject[]What would make the emails more likely to reach an inbox and be answered.
data.content.advice[].stepintegerThe step, counted from 1.
data.content.advice[].versionintegerThe version of the step, counted from 1.
data.content.advice[].fieldsubject | body
data.content.advice[].codestring
data.content.advice[].messagestring
data.content.variablesobject[]The placeholders your texts use beyond the sender's own. required ones have no fallback: a recipient without a value is left out.
data.content.variables[].namestring
data.content.variables[].requiredboolean
data.previewobject[]On a dry run: the first email as the first recipients would get it, in the first version of the step when it has variants. The name in {{sender_first_name}} is an example; each recipient is written to by one of our mailboxes under its own name.
data.preview[].tostring
data.preview[].subjectstring
data.preview[].bodystring
data.estimateobjectWhat the campaign comes to at most.
data.estimate.emailsintegerEmails if nobody answers: recipients times steps.
data.estimate.max_costnumberWhat that would cost, in US dollars. Replies, bounces and unsubscribes make it less.
data.estimate.daysintegerAbout how many days until the last email, at the daily limit.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

Example

curl https://api.won.dev/v1/email/campaigns \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sender_id": "snd_4k2m9x7p1q8w3e5r",
  "name": "US chair importers, November",
  "steps": [
    {
      "subject": "Office chairs for {{company}}",
      "body": "Hi {{first_name|there}},\n\nI saw that {{company}} imports office seating. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\n{{sender_first_name}}"
    },
    {
      "delay_days": 3,
      "body": "Hi {{first_name|there}},\n\nJust checking that my note reached the right person. Who looks after seating suppliers at {{company}}?\n\n{{sender_first_name}}"
    }
  ],
  "recipients": [
    {
      "email": "dana.whitfield@harborline-imports.example",
      "first_name": "Dana",
      "company": "Harborline Imports",
      "country": "US"
    },
    {
      "email": "info@coastal-office.example",
      "company": "Coastal Office Supply"
    }
  ],
  "daily_limit": 30,
  "max_cost": 25,
  "start": false
}'
{
  "data": {
    "dry_run": false,
    "campaign": {
      "id": "cmp_7p1q8w3e5r4k2m9x",
      "name": "US chair importers, November",
      "sender_id": "snd_4k2m9x7p1q8w3e5r",
      "tenant_id": null,
      "status": "draft",
      "pause_reason": null,
      "steps": [
        {
          "delay_days": 0,
          "versions": [
            {
              "subject": "Office chairs for {{company}}",
              "body": "Hi {{first_name|there}},\n\nI saw that {{company}} imports office seating. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\n{{sender_first_name}}",
              "weight": 1,
              "stats": {
                "sent": 0,
                "opened": 0,
                "clicked": 0,
                "replied": 0
              }
            }
          ]
        },
        {
          "delay_days": 3,
          "versions": [
            {
              "subject": null,
              "body": "Hi {{first_name|there}},\n\nJust checking that my note reached the right person. Who looks after seating suppliers at {{company}}?\n\n{{sender_first_name}}",
              "weight": 1,
              "stats": {
                "sent": 0,
                "opened": 0,
                "clicked": 0,
                "replied": 0
              }
            }
          ]
        }
      ],
      "schedule": {
        "timezone": "America/New_York",
        "days": [
          "mon",
          "tue",
          "wed",
          "thu",
          "fri"
        ],
        "start_hour": 9,
        "end_hour": 17
      },
      "daily_limit": 30,
      "stop_on_company_reply": true,
      "track_opens": false,
      "track_clicks": false,
      "max_cost": 25,
      "metadata": {
        "customer_id": "c_812"
      },
      "stats": {
        "recipients": 2,
        "waiting": 2,
        "in_sequence": 0,
        "finished": 0,
        "replied": 0,
        "bounced": 0,
        "unsubscribed": 0,
        "excluded": 0,
        "emails_sent": 0,
        "emails_opened": 0,
        "emails_clicked": 0,
        "spent": 0,
        "reserved": 0
      },
      "test": false,
      "created_at": "2026-11-18T14:03:10.000Z",
      "started_at": null,
      "completed_at": null
    },
    "recipients": {
      "accepted": 2,
      "duplicates": 0,
      "rejected": 0,
      "results": [
        {
          "email": "info@coastal-office.example",
          "status": "accepted",
          "recipient_id": "rcp_5r4k2m9x7p1q8w3e",
          "reason": null,
          "message": null,
          "warnings": [
            "shared_mailbox"
          ]
        }
      ]
    },
    "content": {
      "problems": [],
      "advice": [],
      "variables": [
        {
          "name": "company",
          "required": true
        },
        {
          "name": "first_name",
          "required": false
        }
      ]
    },
    "preview": [],
    "estimate": {
      "emails": 4,
      "max_cost": 0.12,
      "days": 4
    }
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}

A test key (won_test_...) runs this in the sandbox: nothing is sent and nothing is charged.

On this page