Skip to Content
Won.dev

Cold email API

Send cold email sequences from warmed-up mailboxes of ours. You bring the list and the texts; sending, follow-ups, replies, bounces and unsubscribes are handled.

The cold email API runs outreach for you or for your agent. You say which company is writing and to whom, and it sends each person a sequence of emails from a mailbox that is already warmed up, reads what comes back, and stops by itself when somebody answers. There is no domain to buy, no mailbox to set up and nothing to warm up.

How it works

  1. Register a sender with POST /email/senders: the company the emails are for and its postal address. Once per company: an agency registers each client as a sender of its own, see Senders and isolation.
  2. Create a campaign with POST /email/campaigns: up to six emails and a list of people. Call it with dry_run: true first to see the emails as they would go out.
  3. We send. Each person hears from one mailbox for the whole sequence, in their own office hours, and follow-ups arrive as replies in the thread of the first email.
  4. People answer. A reply, a bounce or an unsubscribe ends the sequence for that person, without a call from you. GET /email/replies returns what they wrote and what it means.
  5. You keep up with GET /events or a webhook, read the whole exchange with GET /email/recipients/{id}/conversation, and answer with POST /email/replies/{id}/reply.

Endpoints

EndpointRequestCost of the call
Register a senderPOST /email/sendersFree
List sendersGET /email/sendersFree
Get a senderGET /email/senders/{id}Free
Create a campaignPOST /email/campaignsFree
List campaignsGET /email/campaignsFree
Get a campaignGET /email/campaigns/{id}Free
Change a campaignPATCH /email/campaigns/{id}Free
Start a campaignPOST /email/campaigns/{id}/startFree
Pause a campaignPOST /email/campaigns/{id}/pauseFree
Resume a campaignPOST /email/campaigns/{id}/resumeFree
Cancel a campaignPOST /email/campaigns/{id}/cancelFree
Add recipientsPOST /email/campaigns/{id}/recipientsFree
List recipientsGET /email/campaigns/{id}/recipientsFree
Stop a recipientPOST /email/recipients/{id}/stopFree
Get a conversationGET /email/recipients/{id}/conversationFree
List sent emailsGET /email/messagesFree
Send a single emailPOST /email/messagesemail_sent $0.03
List repliesGET /email/repliesFree
Get a replyGET /email/replies/{id}Free
Answer a replyPOST /email/replies/{id}/replyemail_sent $0.03
List suppressionsGET /email/suppressionsFree
Add suppressionsPOST /email/suppressionsFree
Remove a suppressionDELETE /email/suppressions/{id}Free
Get sending capacityGET /email/capacityFree
Request dedicated capacityPOST /email/capacityemail_dedicated_domain $25
Stop dedicated capacityDELETE /email/capacityFree
List eventsGET /eventsFree
Create a webhookPOST /webhooksFree
List webhooksGET /webhooksFree
List webhook deliveriesGET /webhooks/{id}/deliveriesFree
Delete a webhookDELETE /webhooks/{id}Free

A first campaign

Check the texts and the list, and see the first emails, without creating anything:

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": "Importers, November",
  "steps": [
    {
      "subject": "Mesh chairs for {{company|your company}}",
      "body": "Hi {{first_name|there}},\n\nWe make mesh office chairs and ship in three weeks. Would a price list help?\n\n{{sender_first_name}}"
    },
    {
      "delay_days": 3,
      "body": "Hi {{first_name|there}},\n\nJust checking whether my note reached you.\n\n{{sender_first_name}}"
    }
  ],
  "recipients": [
    {
      "email": "dana.whitfield@harborline.example",
      "first_name": "Dana",
      "company": "Harborline"
    }
  ],
  "dry_run": true
}'

The answer lists every address that would be left out and why, problems in the texts, a preview of the first emails and the most the campaign can cost. Send the same request with start: true in place of dry_run to create the campaign and begin. Then ask what happened, every few minutes:

curl "https://api.won.dev/v1/events?cursor=evt_2m9x7p1q8w3e5r4k" \
  -H "Authorization: Bearer $WON_API_KEY"

What goes out

  • Mailboxes. The emails go out from mailboxes of ours, on domains of ours, that have been sending and receiving for weeks. They are shared between customers, but each writes to a company for one sender at a time, see Senders and isolation. Each one writes under a person's name of its own; {{sender_first_name}} and {{sender_name}} stand for it in your texts. You cannot choose the name or bring your own mailbox yet.
  • One mailbox per person. Whoever gets the first email from one mailbox gets every follow-up and every answer of yours from the same one.
  • When. Monday to Friday between 9:00 and 17:00 in the recipient's own time zone, which is taken from their timezone, else their country, else guessed from the address, else the campaign's schedule.timezone. schedule changes the days and hours.
  • How fast. A mailbox sends a few emails a day with minutes between them, because that is what keeps mail out of the spam folder. A list of a thousand people takes days, not minutes. daily_limit caps a campaign (default 50 a day), and a new account has a limit of its own, see Limits.
  • Follow-ups. A step without a subject is sent as a reply in the thread of the first email. delay_days counts sending days: three days after a Thursday is the next Tuesday.
  • Versions. variants on a step tests other texts against it. Each person gets one version, and GET /email/campaigns/{id} shows how each did.
  • Plain text. Emails go out as plain text, the way a person writes. track_opens and track_clicks are off by default: both need HTML, both cost inbox placement, and mail programs that fetch images on their own make opens unreliable.
  • The footer. Every email ends with the sender's company name, its postal address and an unsubscribe link. The law asks for all three, and they cannot be removed:
Northwind Seating, 12 Dock Road, Portland, OR 97201, USA
Not relevant? Unsubscribe: https://won.dev/e/u/...

Senders and isolation

The mailboxes are shared between customers. The people they write to, and what those people answer, are not.

  • Account and senders. An account holds the balance, the API keys and the people who use it. A sender is a company the emails are for: its name and postal address are in every email. A company that writes for itself registers one sender. An agency, or an agent that works for several companies, registers each client as a sender of its own and runs that client's campaigns under it. The account pays for all of them, and every campaign names its sender_id.
  • One sender per company, per mailbox. A mailbox that writes to someone at a company for one sender writes to nobody at that company for any other sender, until 90 days after its last email there. That holds between customers, and between the clients of one account. Nobody hears from the same person on behalf of two companies, and a colleague who answers can only be answering that sender. At free mail services such as gmail.com it holds for each address, not for the whole domain.
  • Replies. A reply is matched to the email it answers. One that names no email of ours is matched by its address, then by its company, among the people that mailbox wrote to, those of the last 90 days first: in that time it wrote to them for one sender only. When the people it could be from still belong to more than one sender, nobody gets the reply until a person on our side has checked whose it is, and the next email to each of them waits 2 days. It then reaches its campaign as an ordinary reply.
  • Waiting for a mailbox. None of this needs more mailboxes or costs more. When many senders write to the same company at once, an email may wait for a mailbox that is free there: it goes out later, and nothing fails. A sender's campaigns write to one company from at most 3 mailboxes at a time. An answer or a single email leaves from the mailbox its conversation runs in.
  • What a key sees. A key sees its own account and nothing else: senders, campaigns, recipients, replies, events, webhooks and the suppression list. An ID of another account answers not_found. The suppression list belongs to the account: someone who unsubscribes from one sender's emails gets none from any sender of the account, unless the senders are of different tenants.

Tenants

A platform that sends cold email for customers of its own keeps each customer apart with tenant_id. Set it on the customer's senders, to the customer's ID in your own system, such as cus_4821; it cannot be changed. A campaign belongs to the tenant of its sender. A sender without tenant_id is the account's own.

  • Recipients. The same person can be in campaigns of two tenants. Within one tenant, as within an account, a person is in one running campaign at a time.
  • Unsubscribes. Someone who unsubscribes from a tenant's emails gets none from that tenant again, and can still hear from the others. A suppression added with tenant_id holds for that tenant only; one without holds for all your mail. A spam complaint and an address that does not exist hold for the whole account.
  • Limits. A new tenant sends at most 50 emails a day, which rises by itself as it sends without bounces and complaints, as an account's does. All tenants together stay within the account's daily limit.
  • Standing. Each tenant has breakers of its own. A tenant whose emails bounce or are reported as spam too often is stopped alone: its campaigns pause with sending_suspended, an account.suspended event carries its tenant_id, and the other tenants go on. The account's own breakers count the mail without a tenant; when they trip, everything stops.
  • One tenant at a time. GET /email/campaigns, GET /email/replies, GET /email/suppressions and GET /events take tenant_id, and GET /account?tenant_id= shows a tenant's daily limit, what it sent today and its breakers. Every event and webhook carries tenant_id, null for the account's own.

Placeholders

Write {{name}} in a subject or a body, and {{name|fallback}} to say what to use when a person has no such value.

PlaceholderFilled with
{{first_name}}The recipient's first_name, or read off a contact_id.
{{last_name}}The recipient's last_name.
{{company}}The recipient's company.
{{email}}The recipient's address.
{{sender_name}}The full name of the mailbox that writes, such as Alex Morgan.
{{sender_first_name}}Its first name. Sign with this.
{{sender_company}}The sender's company_name.

Your own placeholders take their values from a recipient's variables. A person without a value for a placeholder that has no fallback is left out of the campaign as missing_variable, instead of getting an email with a hole in it.

The list

A recipient is an email address with whatever you know about the person, or a contact_id: the per_ ID of anyone the trade data API or the enrichment API returned to your account with an email in the last 90 days. A person found without one needs it first: POST /enrich/people/email/find with person_id finds it and keeps it with the ID. Up to 1,000 per call and 10,000 per campaign. Each address is checked while you wait, and the answer names every one that was left out:

reasonWhat it means
contact_not_foundNo person with this contact_id was given to this account in the last 90 days. Find them again, or pass the email.
invalid_addressThis is not an email address.
blocked_mailboxThis mailbox is not read by a person (such as noreply@ or postmaster@).
duplicate_in_requestThe same address is earlier in this request.
suppressedThe address or its domain is on your suppression list.
complainedThis person has reported cold email as spam. Nobody on the platform writes to them.
undeliverableThis address bounced recently: the mailbox does not exist.
active_in_other_campaignThis person is in another of your campaigns that is still running.
region_blockedWe do not send cold email to addresses in mainland China.
region_not_declaredThis address is in a region (EU, UK or Canada) the campaign's sender has not declared a lawful basis for. Create a sender with regions.
personal_mailbox_in_regionA private mailbox in the EU, the UK or Canada: cold email to consumers needs their consent there.
campaign_fullA campaign holds at most 10000 recipients.
missing_variableA placeholder without a fallback has no value for this person. Pass the value, or write {{name|fallback}}.

Addresses that pass are then checked for an existing mailbox, which takes a few minutes. The ones that fail become invalid, and cost nothing. When more than one address in ten fails, the campaign pauses with list_quality before it sends to the rest: a list like that is usually old or scraped, and sending to it hurts the mailboxes everybody shares.

Limits

  • No review. Nothing waits for a person: a new sender can send at once, and a campaign starts when you start it. What keeps the shared mailboxes healthy is automatic: the daily limit of a new account or tenant, the checks of every list and text, and the breakers below.
  • Daily limit. A new account sends at most 50 emails a day across its campaigns and single emails. After a week and 200 emails with few bounces it rises to 500 by itself, and we raise it to 2,000 and beyond on request. A tenant has a limit of its own within the account's.
  • Senders and webhooks. Register as many senders as you write for companies. Up to 10 webhooks per account.
  • Regions. To write to people in the EU, the UK or Canada, the sender declares its lawful basis in regions. Private mailboxes there (such as gmail.com) are left out in any case, and we do not send cold email to mainland China.
  • Standing. Because the mailboxes are shared, an account whose emails bounce or are reported as spam too often is stopped automatically: its campaigns pause with sending_suspended and an account.suspended event says so. Keep hard bounces under 3% by sending to lists you have reason to trust.

Replies

Replies are read from the mailboxes every few minutes. Each one is tied to its recipient (see Senders and isolation for how), stripped of the quoted email, and given an intent with a confidence from 0 to 1:

intentWhat it means
interestedWants to hear more, asks for prices or a call.
questionAsks something before deciding.
not_interestedSays no. The sequence ends; they stay off the suppression list.
wrong_personNot the one to ask, often with who is.
unsubscribeAsks not to be written to again. They are suppressed by this alone.
out_of_officeAn automatic note. The sequence goes on, and the next email waits three days.
otherNone of these. Read the text.

A reply ends the sequence for its sender, and with stop_on_company_reply (the default) for their colleagues in the same campaign. To answer, call POST /email/replies/{id}/reply with your text: it goes out from the mailbox the conversation runs in, in the same thread.

Files a reply came with are in its attachments a minute or two after it shows up, each with its name, type and size, and a download_url that works without a key for one hour. Ask for the reply again, with GET /email/replies/{id} or in a list, to get a fresh link. Programs and scripts are never copied, nor files over 15 MB; they are listed as skipped. GET /email/recipients/{id}/conversation returns everything written with one person, oldest first, each email with its full text.

Writing outside the sequence

  • Answers. POST /email/replies/{id}/reply answers a reply, in its thread, with the reply quoted underneath.
  • Single emails. POST /email/messages writes one email: again to someone a campaign has written to (recipient_id), or to a colleague a reply pointed you to (reply_id and to), who must be at the same company as the person who replied or be named in the reply. Without subject it goes in the thread of the last email. Someone new belongs in a campaign.
  • The same mailbox. Both leave from the mailbox the conversation runs in, under its name, with the footer. People who unsubscribed, bounced or are on a suppression list cannot be written to. Single emails count toward the daily limit; answers do not. When that mailbox now writes to the person's company for another sender, after 90 days of silence or for a colleague at another company, the call fails with invalid_state and costs nothing: add them to a new campaign.
  • Files. Both take up to 3 attachments, 10 MB together: .pdf, .png, .jpg, .jpeg, .gif, .webp, .docx, .xlsx, .pptx, .doc, .xls, .ppt, .csv, .txt. Give each as base64 content, up to about 3 MB, or as a public https:// url that is fetched while the email is sent. A file is checked by its name and by its first bytes, so a program renamed to .pdf is refused with invalid_input.

Sending capacity

The emails go out from a shared pool of warmed-up mailboxes, a few per mailbox per day. GET /email/capacity shows how many the account may send a day and what one costs.

  • More mailboxes for a campaign. When a campaign that starts needs more than the pool can carry, mailboxes can be added for it. They take a few days to reach full speed, and the campaign sends what the pool allows meanwhile. The campaign then commits to $0.03 (email_capacity) for each email they were added for, 500 per domain: that is set aside from the balance, counts toward the campaign's max_cost, and every email the campaign sends uses up its part. What is left after 30 days is charged. Nothing is added for a campaign whose balance or max_cost cannot cover the commitment; it sends on what the pool has.
  • Dedicated capacity. From 200 emails a day, once the account has sent on the shared pool for 7 days and 200 emails with few bounces and no complaints, POST /email/capacity gives the account mailboxes of its own that nobody else writes from. Once they can carry what the account sends on the shared pool, it sends only from them, and its daily limit becomes the plan's volume as they come up to speed. Each email then costs $0.01 (email_sent_dedicated), and the plan $25 (email_dedicated_domain) per 50 emails a day for 30 days, charged at once and at the start of every period. Call it without confirm: true first for the price. New mailboxes reach full speed in about 6 days. A period that cannot be paid gets 7 days of grace; after that the plan ends. DELETE /email/capacity lets it end with the period that is paid.

Billing

  • email_sent, $0.03 for each email handed to the mail server. That is every step for every person, and every answer and single email you send.
  • With dedicated capacity, email_sent_dedicated at $0.01 takes its place, and email_dedicated_domain costs $25 for each domain of your own and 30 days. Mailboxes added for a campaign are charged as email_capacity, $0.03 for each committed email the campaign did not send.
  • Everything else is free: creating and checking, replies coming in and their files, events and webhooks. An address that fails a check never costs anything.
  • A step that hard-bounces is refunded. An answer or a single email is charged by its call, and is not.
  • A running campaign sets aside the cost of about a week of sending. stats.reserved shows it, and it returns to the balance when the campaign pauses, ends or is canceled.
  • When the balance runs out, the campaign pauses with insufficient_balance instead of sending on credit. Top up and resume.
  • max_cost on a campaign caps what it may spend in its whole life.

A call that is charged says so in usage, like every paid call of the API:

{
  "usage": {
    "unit": "email_sent",
    "records": 1,
    "cost": 0.03,
    "balance": 48.05,
    "replayed": false
  }
}

Events and webhooks

Everything that happens is an event. Read them with GET /events, passing the next_cursor of your previous call as cursor, or have them pushed to a URL with POST /webhooks. Events are kept for 30 days.

TypeWhen
sender.approvedA sender that we had stopped may send again.
sender.rejectedWe stopped a sender. data.review_note says why.
campaign.startedA campaign began sending.
campaign.pausedA campaign stopped sending. data.reason is the pause_reason.
campaign.resumedA paused campaign continues.
campaign.completedEverybody in the campaign got every email, or left the sequence.
campaign.canceledA campaign was called off by you.
email.sentOne email was handed over. Frequent: a webhook gets it only when it names it.
email.openedA person opened an email of a campaign that tracks opens. Frequent.
email.clickedA person followed a link in a campaign that tracks clicks. Frequent.
email.bouncedAn email came back. data.bounce_type is hard (no such mailbox, refunded) or soft.
reply.receivedSomebody answered. data carries the reply with its intent.
recipient.unsubscribedSomebody unsubscribed, by the link or by saying so. They are on the suppression list.
account.suspendedSending was stopped for the whole account, or for one tenant when tenant_id is set: too many bounces or spam complaints.
task.completedA task of POST /tasks ended. data is the task; data.status is completed, failed or canceled.

Every event carries metadata: keys and values of your own, such as your customer's ID, given as metadata when a campaign is created or a recipient is added. An event about a campaign carries the campaign's, one about a recipient the campaign's with the recipient's over it, and task.completed the task's. They stay what they were when the event happened. A webhook's own metadata stays with the webhook, since the same event goes to every webhook.

A webhook delivery is a JSON POST of the event. Answer with any 2xx within 10 seconds. Anything else is tried again, eight times over about a day; a webhook that fails for three days is switched off. The same event can arrive twice, so tell events apart by id. Check that a delivery is ours before acting on it:

import { createHmac, timingSafeEqual } from "node:crypto";

// `rawBody` is the request body exactly as it arrived, before any JSON parsing.
function isGenuine(rawBody, signatureHeader, signingSecret) {
  const parts = Object.fromEntries(signatureHeader.split(",").map((part) => part.split("=")));
  // Older than five minutes: a recording played back.
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
  const expected = createHmac("sha256", signingSecret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  return (
    parts.v1.length === expected.length &&
    timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected))
  );
}

Statuses

A campaign:

statusWhat it means
draftCreated, not started. Nothing is sent.
in_reviewNo longer given. A campaign that was waiting for a review from before starts by itself within minutes.
activeSending.
pausedNot sending until resumed. pause_reason says why.
completedEverybody got every email or left the sequence. Adding recipients reopens it.
canceledCalled off by you. Final.
suspendedStopped by us. Final.

Why a campaign is paused:

pause_reasonWhat it means
manualYou paused it.
insufficient_balanceThe balance cannot cover the next email. Top up, then resume.
max_costThe campaign reached its own max_cost.
list_qualityMore than one address in ten cannot take mail. Check the list; resuming accepts it as it is.
sending_suspendedSending is stopped for the account or for everybody. We resume it.

A recipient:

statusWhat it means
verifyingThe address is being checked for an existing mailbox.
scheduledPassed the checks, waits for the first email.
activeGot at least one email, more to come.
repliedAnswered. Final.
completedGot every email and did not answer. Final.
bouncedThe mailbox does not exist or does not take mail. Final.
unsubscribedUnsubscribed or complained. Final.
suppressedCame onto a suppression list after being added. Final.
invalidFailed the address check. Never written to, never charged. Final.
stoppedStopped by you, or the mail server refused the email. Final.

Sandbox

A key that starts with won_test_ runs everything in a sandbox: the same endpoints, the same checks and the same events, but nothing is sent and nothing is charged. A day between steps takes a minute, so a whole sequence plays out while you watch. The first part of an address decides what its owner does:

Address starts withWhat happens
replyAnswers the first email, interested, with a PDF attached.
noAnswers that they are not interested.
oooSends an out-of-office note.
bounceThe first email bounces, hard.
unsubscribeFollows the unsubscribe link.
invalidFails the address check.

Any other address gets every step and never answers. The sandbox has its own senders, campaigns, suppression list and webhooks: a test key sees nothing of the real account, and what it simulates never reaches a real webhook. Its events carry test: true.

Sending a request twice

  • POST, PATCH and DELETE requests take an Idempotency-Key header: any unique string. A retry with the same key and the same parameters returns the first answer and does nothing twice. The same key with different parameters fails with idempotency_conflict. POST /webhooks is the exception: its answer holds a secret that is never stored, so it is not given twice. A retry with the same URL fails with invalid_state and names the webhook the first call made; for a new secret, delete it and create it again. See Idempotency.
  • Without a key, the list protects itself: a person who is already in a campaign of yours that has not ended is left out of the next one, and adding the same list to a campaign twice changes nothing.
  • The same answer to the same reply, and the same single email, within 24 hours is sent once.

On this page