Skip to Content
Won.dev
DocumentationAPI reference
Cold email API

Send a test email

Send a step to your own inbox, as a recipient will get it, before anybody else gets it. Free.

Sends one step of the campaign now to someone of your own team, to read it as a recipient will: from one of the sender's mailboxes, under its name, with the footer and the unsubscribe link, which opens its page and records nothing. The placeholders are filled in with a recipient's details: the one in recipient_id, or else the campaign's first, or with the fallbacks while it has none. A follow-up comes with the Re: subject and the email before it quoted underneath. Works on drafts too. It counts toward what the sender's domains may send today, and an account sends at most 20 test emails a day (daily_limit_reached) and 5 a minute (rate_limited). Fails with no_domains while the sender has no sending domain. A test key sends nothing: simulated is true and text is what would have gone out. Free.

  • Billing: The call is free, and so are the emails: they go out from the sender's sending domains, paid for by the month, see Sending domains.

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

POST
/email/campaigns/{id}/test

Authorization

apiKey
headerAuthorizationBearer <API key>

Authorization: Bearer won_live_..., a key from the console.

Path Parameters

id*string

Campaign ID, such as cmp_7p1q8w3e5r4k2m9x.

Lengthlength <= 40

Header Parameters

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

Lengthlength <= 255

Request Body

application/json
  1. body
to?string

Who gets it: the address someone of your account signs in with. Leave it out to send it to the account's owner.

Lengthlength <= 254
step?integer

The step, counted from 1.

Range1 <= value <= 20
Default1
version?integer

The version of the step, counted from 1.

Range1 <= value <= 20
Default1
recipient_id?string

The recipient whose details fill in the placeholders, such as rcp_9x7p1q8w3e5r4k2m. They get nothing.

Lengthlength <= 40

Response Body

The result.

application/json
  1. response
data*
notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

Example Request
curl -X POST 'https://api.won.dev/v1/email/campaigns/cmp_7p1q8w3e5r4k2m9x/test' \  -H 'Content-Type: application/json' \  -d '{  "id": "cmp_7p1q8w3e5r4k2m9x",  "to": "jamie@northwind-seating.example",  "step": 1,  "version": 1}'
Example Response
{  "data": {    "id": "tst_3e5r4k2m9x7p",    "campaign_id": "cmp_7p1q8w3e5r4k2m9x",    "from": "alex@northwindseating.example",    "to": "jamie@northwind-seating.example",    "step": 1,    "version": 1,    "recipient_id": "rcp_9x7p1q8w3e5r4k2m",    "subject": "Office chairs for Harborline Imports",    "text": "Hi Dana,\n\nI saw that Harborline Imports 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\nAlex\n\nNorthwind Seating Ltd, 18 Harbour Road, Leeds LS1 4AP, United Kingdom\nNot relevant? Unsubscribe: https://won.dev/e/u/9k2m4x",    "simulated": false,    "sent_at": "2026-11-18T13:40:02.000Z"  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}