跳到正文
Won.dev
文档API 参考
冷邮件 API

购买发信域名

为发件方购买发信域名:每个带 3 个预热好的邮箱,每天 45 封,每月 $27。

为一个发件方购买发信域名:每个域名带 3 个已预热的邮箱,只为这个发件方发信,让它每天多发 45 封。无需任何配置:不用设置 DNS,不用登录邮箱,回信也由我们读取。每个域名每天 $0.9,从续费日起每次付 30 天。所有域名都在每月的同一天续费,所以第一个周期从今天到那一天:15 到 45 天,现在支付。每个域名会在 period_end 前 3 天自动从余额续费;余额不足时会一直重试到前一天,之后域名会被释放。不带 confirm: true 时只报价,并给出续费日期和库存数量,不做任何改动。新域名几分钟内就绪(domain.ready),第一天可发 15 封,5 天后达到全速。该发件方因 no_domains 暂停的活动会在域名就绪后自动继续。库存不足时返回 out_of_stock,不会扣费。单次最多 10 个。测试 key 只会拿到报价:沙箱中每个发件方都已有一个模拟域名。每次带 confirm: true 的调用都会再买一次:请带上 Idempotency-Key,让重试变得安全。

  • 计费: email_domain_day $0.9:一个发信域名使用一天。带 confirm: true 时立即按到 period_end 的天数扣费,之后在每次续费前 3 天按 30 天扣费。不带时只报价,免费。

用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。

POST
/email/domains

鉴权

apiKey
headerAuthorizationBearer <API key>

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

请求头参数

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.

长度length <= 255

请求体

application/json
  1. body
sender_id*string

The sender to buy them for, such as snd_4k2m9x7p1q8w3e5r. They never send for another.

长度length <= 40
count?integer

How many domains, 1 to 10.

范围1 <= value <= 10
默认值1
confirm?boolean

True buys them and charges this period. False, the default, only quotes it.

默认值false
max_cost?number

Spending cap for this call in US dollars. If the call could cost more, it fails with budget_exceeded before anything is charged.

范围0 < value

响应体

The result.

application/json
  1. response
data*

The domains and their price.

notice*|

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

usage*

What this call was charged, and the balance left.

请求示例
curl -X POST 'https://api.won.dev/v1/email/domains' \  -H 'Content-Type: application/json' \  -d '{  "sender_id": "snd_4k2m9x7p1q8w3e5r",  "count": 1,  "confirm": true,  "max_cost": 30}'
响应示例
{  "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  }}

最后更新于