# Buy sending domains

Source: https://won.dev/docs/email/domains-create

`POST https://api.won.dev/v1/email/domains`

Buys sending domains for one sender: each comes with 3 mailboxes that are already warmed up, sends for that sender alone, and adds 45 emails a day to what it can send. Nothing to set up: no DNS, no mailbox to sign in to, and replies are read for you. A domain costs $0.9 a day, 30 days at a time from the renewal date on. All domains renew on the same day of the month, so the first period runs from today to that day: 15 to 45 days, paid now. Each renews by itself from your balance 3 days before `period_end`; if the balance cannot cover it, it is tried again until the day before, and the domain is then given up. Without `confirm: true` this only quotes the price, the date and how many are in stock, and changes nothing. A new domain is ready within minutes (`domain.ready`) and sends 15 emails on its first day, reaching full speed in 5 days. Campaigns of the sender that were paused for `no_domains` go on by themselves once it is. Fails with `out_of_stock` when not enough are for sale, before anything is charged. Up to 10 at once. A test key only gets the quote: in the sandbox every sender has a simulated domain already. Each call that confirms buys again: send an `Idempotency-Key` to make a retry safe.

- **Billing:** `email_domain_day` $0.9: one sending domain for one day. With `confirm: true` the days up to `period_end` are charged at once, then 30 at a time, 3 days before each renewal. Without it the call only quotes, for free.

A test key (`won_test_...`) runs this in the [sandbox](/docs/email#sandbox): nothing is sent and nothing is charged.

## Parameters [#parameters]

Parameters go in the JSON body. `POST` requests also take an `Idempotency-Key` header, see [Sending a request twice](/docs/email#idempotency).

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `sender_id` | string | yes | The sender to buy them for, such as `snd_4k2m9x7p1q8w3e5r`. They never send for another. |
| `count` | integer | no | How many domains, 1 to 10. Default: `1`. |
| `confirm` | boolean | no | True buys them and charges this period. False, the default, only quotes it. Default: `false`. |
| `max_cost` | number | no | Spending cap for this call in US dollars. If the call could cost more, it fails with `budget_exceeded` before anything is charged. |

## Response [#response]

Errors are described in [Errors](/docs/errors).

| Field | Type | Description |
| --- | --- | --- |
| `data` | object | The domains and their price. |
| `data.confirmed` | boolean | True when the domains were bought. False on a quote: nothing changed. |
| `data.sender_id` | string |  |
| `data.count` | integer | How many domains. |
| `data.price` | number | What they cost now, together, in US dollars: this period, up to `period_end`. |
| `data.price_per_domain` | number | What one costs for this period, in US dollars. |
| `data.days` | integer | Days this period has, today included. |
| `data.period_end` | string | When this period ends and they renew, at `price_per_month` each, charged from your balance 3 days before. |
| `data.price_per_month` | number | What one domain costs for 30 days, from then on. |
| `data.daily_limit` | integer | What they add to the sender's day at full speed: 45 each. |
| `data.first_day_limit` | integer | What they send on their first day, together. |
| `data.days_to_full_speed` | integer | Days until they send at full speed. |
| `data.in_stock` | integer | How many domains can be bought right now. |
| `data.domains` | object[] | The domains bought, `setting_up` for a few minutes. Empty on a quote. |
| `data.domains[].id` | string | Domain ID, such as `dom_5r4k2m9x7p1q8w3e`. |
| `data.domains[].sender_id` | string | The sender it sends for. It never sends for another. |
| `data.domains[].domain` | string \| null | The domain name. Null for the minutes after it was paid for, until one is chosen and bought. |
| `data.domains[].status` | `setting_up` \| `ramping` \| `active` \| `paused` \| `ending` \| `released` \| `failed` | `setting_up` for the minutes it takes to buy it and set up its mailboxes. `ramping` while it sends a few emails a day more each day, for 5 days. `active` at full speed. `paused` while we hold it back. `ending` once it will not renew: it sends until 1 day before `period_end`. Final: `released` (its mailboxes are gone) and `failed` (it could not be bought; what it cost went back to the balance). |
| `data.domains[].end_reason` | `canceled` \| `unpaid` \| `replaced` \| `removed` \| null | Why it ends or ended: `canceled` by you, `unpaid` (the renewal could not be charged), `replaced` by a new domain, `removed` by us. Null while it renews. |
| `data.domains[].mailboxes` | object[] | Its mailboxes, 3 as a rule. Empty while it is set up. Replies to them are read for you: you never sign in to them. |
| `data.domains[].mailboxes[].address` | string | The address emails go out from, and replies come back to. |
| `data.domains[].mailboxes[].name` | string | The name it sends under, the one it was warmed up with. |
| `data.domains[].daily_limit` | integer | What its mailboxes may send today, together. |
| `data.domains[].full_daily_limit` | integer | What they send a day at full speed, together: 45. |
| `data.domains[].sent_today` | integer | Emails they sent since midnight UTC. Answers to replies are left out. |
| `data.domains[].full_speed_at` | string \| null | When it reaches full speed, while it is `ramping`. Null otherwise. |
| `data.domains[].price_per_month` | number | What a renewal costs, for 30 days, in US dollars. |
| `data.domains[].period_end` | string | When the paid period ends. The next one is charged from your balance a few days before, as an ISO 8601 time in UTC. |
| `data.domains[].renews` | boolean | Whether it renews at `period_end`. False once you canceled it. |
| `data.domains[].ends_at` | string \| null | When it stops sending and its mailboxes are given up, when it will not renew. Null while it renews. |
| `data.domains[].renewal_failed_at` | string \| null | When charging the renewal last failed for want of balance. It is tried again until the day before `period_end`, then the domain is given up. Null when nothing failed. |
| `data.domains[].stats` | object | The last 30 days. |
| `data.domains[].stats.sent` | integer | Emails sent. |
| `data.domains[].stats.bounced` | integer | Of them, how many bounced because the mailbox does not exist. |
| `data.domains[].stats.bounce_rate` | number | `bounced` over `sent`, 0 to 1. |
| `data.domains[].stats.complaints` | integer | Recipients who reported its emails as spam. |
| `data.domains[].test` | boolean | The simulated domain of a test key's sender: it never sends for real. |
| `data.domains[].created_at` | string | When it was bought, as an ISO 8601 time in UTC. |
| `data.domains[].ready_at` | string \| null | When its mailboxes could send. |
| `data.domains[].ended_at` | string \| null | When it was released, or failed. |
| `notice` | string \| null | A plain sentence when there is something to know about this answer. Null otherwise. |
| `usage` | object | What this call was charged, and the balance left. |
| `usage.cost` | number | What this call cost, in US dollars. |
| `usage.breakdown` | object[] | Every billing unit that came back, charged or not. Empty when nothing did. |
| `usage.breakdown[].unit` | `email_domain_day` | What is counted. |
| `usage.breakdown[].records` | integer | How many were returned and charged. |
| `usage.breakdown[].already_paid` | integer | How many more were returned for free, because this organization paid for them in the last 30 days. |
| `usage.breakdown[].cost` | number | What they cost, in US dollars. |
| `usage.balance` | number | The balance left after this call, in US dollars. |
| `usage.replayed` | boolean | True when this is a repeat of a request from the last 24 hours. Repeats are free. |

## Example [#example]

```bash
curl https://api.won.dev/v1/email/domains \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sender_id": "snd_4k2m9x7p1q8w3e5r",
  "count": 1,
  "confirm": true,
  "max_cost": 30
}'
```

```json
{
  "data": {
    "confirmed": true,
    "sender_id": "snd_4k2m9x7p1q8w3e5r",
    "count": 1,
    "price": 28.8,
    "price_per_domain": 28.8,
    "days": 32,
    "period_end": "2026-12-28T00:00:00.000Z",
    "price_per_month": 27,
    "daily_limit": 45,
    "first_day_limit": 15,
    "days_to_full_speed": 5,
    "in_stock": 24,
    "domains": [
      {
        "id": "dom_5r4k2m9x7p1q8w3e",
        "sender_id": "snd_4k2m9x7p1q8w3e5r",
        "domain": null,
        "status": "setting_up",
        "end_reason": null,
        "mailboxes": [],
        "daily_limit": 0,
        "full_daily_limit": 45,
        "sent_today": 0,
        "full_speed_at": null,
        "price_per_month": 27,
        "period_end": "2026-12-28T00:00:00.000Z",
        "renews": true,
        "ends_at": null,
        "renewal_failed_at": null,
        "stats": {
          "sent": 0,
          "bounced": 0,
          "bounce_rate": 0,
          "complaints": 0
        },
        "test": false,
        "created_at": "2026-11-26T10:15:02.000Z",
        "ready_at": null,
        "ended_at": null
      }
    ]
  },
  "notice": null,
  "usage": {
    "cost": 28.8,
    "breakdown": [
      {
        "unit": "email_domain_day",
        "records": 32,
        "already_paid": 0,
        "cost": 28.8
      }
    ],
    "balance": 19.28,
    "replayed": false
  }
}
```