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.
- Base URL:
https://api.won.dev/v1 - OpenAPI 3.1 document:
https://api.won.dev/v1/openapi.json - The same as tools for an agent: see MCP server.
- Authentication, the
usageobject and error handling are the same as in the trade data API.
How it works
- 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. - Create a campaign with
POST /email/campaigns: up to six emails and a list of people. Call it withdry_run: truefirst to see the emails as they would go out. - 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.
- People answer. A reply, a bounce or an unsubscribe ends the sequence for that person, without a call from you.
GET /email/repliesreturns what they wrote and what it means. - You keep up with
GET /eventsor a webhook, read the whole exchange withGET /email/recipients/{id}/conversation, and answer withPOST /email/replies/{id}/reply.
Endpoints
| Endpoint | Request | Cost of the call |
|---|---|---|
| Register a sender | POST /email/senders | Free |
| List senders | GET /email/senders | Free |
| Get a sender | GET /email/senders/{id} | Free |
| Create a campaign | POST /email/campaigns | Free |
| List campaigns | GET /email/campaigns | Free |
| Get a campaign | GET /email/campaigns/{id} | Free |
| Change a campaign | PATCH /email/campaigns/{id} | Free |
| Start a campaign | POST /email/campaigns/{id}/start | Free |
| Pause a campaign | POST /email/campaigns/{id}/pause | Free |
| Resume a campaign | POST /email/campaigns/{id}/resume | Free |
| Cancel a campaign | POST /email/campaigns/{id}/cancel | Free |
| Add recipients | POST /email/campaigns/{id}/recipients | Free |
| List recipients | GET /email/campaigns/{id}/recipients | Free |
| Stop a recipient | POST /email/recipients/{id}/stop | Free |
| Get a conversation | GET /email/recipients/{id}/conversation | Free |
| List sent emails | GET /email/messages | Free |
| Send a single email | POST /email/messages | email_sent $0.03 |
| List replies | GET /email/replies | Free |
| Get a reply | GET /email/replies/{id} | Free |
| Answer a reply | POST /email/replies/{id}/reply | email_sent $0.03 |
| List suppressions | GET /email/suppressions | Free |
| Add suppressions | POST /email/suppressions | Free |
| Remove a suppression | DELETE /email/suppressions/{id} | Free |
| Get sending capacity | GET /email/capacity | Free |
| Request dedicated capacity | POST /email/capacity | email_dedicated_domain $25 |
| Stop dedicated capacity | DELETE /email/capacity | Free |
| List events | GET /events | Free |
| Create a webhook | POST /webhooks | Free |
| List webhooks | GET /webhooks | Free |
| List webhook deliveries | GET /webhooks/{id}/deliveries | Free |
| Delete a webhook | DELETE /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 theircountry, else guessed from the address, else the campaign'sschedule.timezone.schedulechanges 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_limitcaps a campaign (default 50 a day), and a new account has a limit of its own, see Limits. - Follow-ups. A step without a
subjectis sent as a reply in the thread of the first email.delay_dayscounts sending days: three days after a Thursday is the next Tuesday. - Versions.
variantson a step tests other texts against it. Each person gets one version, andGET /email/campaigns/{id}shows how each did. - Plain text. Emails go out as plain text, the way a person writes.
track_opensandtrack_clicksare 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_idholds 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, anaccount.suspendedevent carries itstenant_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/suppressionsandGET /eventstaketenant_id, andGET /account?tenant_id=shows a tenant's daily limit, what it sent today and its breakers. Every event and webhook carriestenant_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.
| Placeholder | Filled 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:
reason | What it means |
|---|---|
contact_not_found | No person with this contact_id was given to this account in the last 90 days. Find them again, or pass the email. |
invalid_address | This is not an email address. |
blocked_mailbox | This mailbox is not read by a person (such as noreply@ or postmaster@). |
duplicate_in_request | The same address is earlier in this request. |
suppressed | The address or its domain is on your suppression list. |
complained | This person has reported cold email as spam. Nobody on the platform writes to them. |
undeliverable | This address bounced recently: the mailbox does not exist. |
active_in_other_campaign | This person is in another of your campaigns that is still running. |
region_blocked | We do not send cold email to addresses in mainland China. |
region_not_declared | This 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_region | A private mailbox in the EU, the UK or Canada: cold email to consumers needs their consent there. |
campaign_full | A campaign holds at most 10000 recipients. |
missing_variable | A 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_suspendedand anaccount.suspendedevent 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:
intent | What it means |
|---|---|
interested | Wants to hear more, asks for prices or a call. |
question | Asks something before deciding. |
not_interested | Says no. The sequence ends; they stay off the suppression list. |
wrong_person | Not the one to ask, often with who is. |
unsubscribe | Asks not to be written to again. They are suppressed by this alone. |
out_of_office | An automatic note. The sequence goes on, and the next email waits three days. |
other | None 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}/replyanswers a reply, in its thread, with the reply quoted underneath. - Single emails.
POST /email/messageswrites one email: again to someone a campaign has written to (recipient_id), or to a colleague a reply pointed you to (reply_idandto), who must be at the same company as the person who replied or be named in the reply. Withoutsubjectit 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_stateand 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 base64content, up to about 3 MB, or as a publichttps://urlthat is fetched while the email is sent. A file is checked by its name and by its first bytes, so a program renamed to.pdfis refused withinvalid_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'smax_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 ormax_costcannot 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/capacitygives 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 withoutconfirm: truefirst 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/capacitylets 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_dedicatedat $0.01 takes its place, andemail_dedicated_domaincosts $25 for each domain of your own and 30 days. Mailboxes added for a campaign are charged asemail_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.reservedshows 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_balanceinstead of sending on credit. Top up and resume. max_coston 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.
| Type | When |
|---|---|
sender.approved | A sender that we had stopped may send again. |
sender.rejected | We stopped a sender. data.review_note says why. |
campaign.started | A campaign began sending. |
campaign.paused | A campaign stopped sending. data.reason is the pause_reason. |
campaign.resumed | A paused campaign continues. |
campaign.completed | Everybody in the campaign got every email, or left the sequence. |
campaign.canceled | A campaign was called off by you. |
email.sent | One email was handed over. Frequent: a webhook gets it only when it names it. |
email.opened | A person opened an email of a campaign that tracks opens. Frequent. |
email.clicked | A person followed a link in a campaign that tracks clicks. Frequent. |
email.bounced | An email came back. data.bounce_type is hard (no such mailbox, refunded) or soft. |
reply.received | Somebody answered. data carries the reply with its intent. |
recipient.unsubscribed | Somebody unsubscribed, by the link or by saying so. They are on the suppression list. |
account.suspended | Sending was stopped for the whole account, or for one tenant when tenant_id is set: too many bounces or spam complaints. |
task.completed | A 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:
status | What it means |
|---|---|
draft | Created, not started. Nothing is sent. |
in_review | No longer given. A campaign that was waiting for a review from before starts by itself within minutes. |
active | Sending. |
paused | Not sending until resumed. pause_reason says why. |
completed | Everybody got every email or left the sequence. Adding recipients reopens it. |
canceled | Called off by you. Final. |
suspended | Stopped by us. Final. |
Why a campaign is paused:
pause_reason | What it means |
|---|---|
manual | You paused it. |
insufficient_balance | The balance cannot cover the next email. Top up, then resume. |
max_cost | The campaign reached its own max_cost. |
list_quality | More than one address in ten cannot take mail. Check the list; resuming accepts it as it is. |
sending_suspended | Sending is stopped for the account or for everybody. We resume it. |
A recipient:
status | What it means |
|---|---|
verifying | The address is being checked for an existing mailbox. |
scheduled | Passed the checks, waits for the first email. |
active | Got at least one email, more to come. |
replied | Answered. Final. |
completed | Got every email and did not answer. Final. |
bounced | The mailbox does not exist or does not take mail. Final. |
unsubscribed | Unsubscribed or complained. Final. |
suppressed | Came onto a suppression list after being added. Final. |
invalid | Failed the address check. Never written to, never charged. Final. |
stopped | Stopped 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 with | What happens |
|---|---|
reply | Answers the first email, interested, with a PDF attached. |
no | Answers that they are not interested. |
ooo | Sends an out-of-office note. |
bounce | The first email bounces, hard. |
unsubscribe | Follows the unsubscribe link. |
invalid | Fails 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,PATCHandDELETErequests take anIdempotency-Keyheader: 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 withidempotency_conflict.POST /webhooksis the exception: its answer holds a secret that is never stored, so it is not given twice. A retry with the same URL fails withinvalid_stateand 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.