冷邮件 API
申请专用容量
开通每天 200 到 5,000 封的专用邮箱,每封 $0.01,每个域名每 30 天 $25。
POST https://api.won.dev/v1/email/capacity
为你的账户配置一批专用邮箱,每天可发 200 到 5,000 封:其他人的邮件不会从这些邮箱发出,每封邮件收费 $0.01,而不是 $0.03。套餐按发信域名售卖,每个域名每天 50 封,每 30 天 $25,开通时立即扣费,之后每个周期开始时再扣。新邮箱起步较慢,约 6 天后达到全速(见 ready_per_day):在它们能承接你的账户在共享池上的发送量之前,活动会继续在共享池上按原有每日上限发送,之后只从你的专用邮箱发出,上限为套餐的发信量。不带 confirm: true 时只报价,不做任何改动。如需扩容,直接申请更大的发信量即可:新周期按新规模开始,当前周期未用完的部分退回余额。套餐运行期间不能缩容。账户需要先在共享池上发信满 7 天且至少 200 封,并且退信少、无投诉。测试 key 只会拿到报价。
- 计费:
email_dedicated_domain$25:一个专用发信域名使用 30 天,带confirm: true时扣费,之后每个周期开始时再扣。不带时只报价,免费。
参数
参数放在 JSON 请求体里。POST 请求还支持 Idempotency-Key 请求头,见重复请求。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
daily_volume | integer | 是 | The emails a day you want to send from mailboxes of your own, 200 to 5000. Rounded up to whole domains of 50. |
confirm | boolean | 否 | True starts or grows the plan and charges its first period. False, the default, only quotes it. Default: 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. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object | The plan and its price. |
data.confirmed | boolean | True when the plan was started or grown. False on a quote: nothing changed. |
data.daily_volume | integer | The emails a day the plan is for. |
data.domains | integer | Sending domains of your own, at 50 emails a day each. |
data.price_per_period | number | What one period of 30 days costs, in US dollars. |
data.credit | number | What the unused part of your current period gives back to your balance when the plan grows, in US dollars. 0 otherwise. |
data.capacity | object | Your capacity after this call. |
data.capacity.type | shared | dedicated | shared while your emails leave from mailboxes other customers write from too, dedicated while you have a plan of mailboxes of your own. |
data.capacity.daily_limit | integer | The most emails this account sends in a day, across all its campaigns. |
data.capacity.sent_today | integer | Emails sent since midnight UTC. |
data.capacity.price_per_email | number | What one email sent costs now, in US dollars. |
data.capacity.dedicated | object | null | Your dedicated plan. Null when you never had one. |
data.capacity.dedicated.status | active | grace | ended | active, grace while a period could not be paid (it ends at grace_until unless the balance is topped up), or ended. |
data.capacity.dedicated.daily_volume | integer | The emails a day the plan is for. |
data.capacity.dedicated.ready_per_day | integer | What your own mailboxes can send today. New mailboxes start slowly and reach full speed in about a week. Your campaigns send from them once this is as much as the account may send on the shared pool, or as the plan is for. |
data.capacity.dedicated.price_per_period | number | What one period of 30 days costs, in US dollars. |
data.capacity.dedicated.period_start | string | When the current period started, as an ISO 8601 time in UTC. |
data.capacity.dedicated.period_end | string | When it ends, and the next one is charged, as an ISO 8601 time in UTC. |
data.capacity.dedicated.renews | boolean | Whether the next period is charged and the plan goes on. |
data.capacity.dedicated.grace_until | string | null | With grace: when the plan ends unless the period is paid. Null otherwise. |
data.capacity.commitments | object[] | Sending capacity added for your campaigns, still being used up. Each email sent uses up its part; what is left at due_at is charged. |
data.capacity.commitments[].campaign_id | string | The campaign the capacity was added for. |
data.capacity.commitments[].emails | integer | The emails committed to. |
data.capacity.commitments[].emails_sent | integer | How many of them were sent. |
data.capacity.commitments[].held | number | What is still set aside for the rest, in US dollars. |
data.capacity.commitments[].due_at | string | When what is still held is charged, as an ISO 8601 time in UTC. |
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_sent | email_sent_dedicated | email_capacity | email_dedicated_domain | 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. |
示例
curl https://api.won.dev/v1/email/capacity \
-H "Authorization: Bearer $WON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"daily_volume": 400,
"confirm": true
}'{
"data": {
"confirmed": true,
"daily_volume": 400,
"domains": 8,
"price_per_period": 200,
"credit": 0,
"capacity": {
"type": "dedicated",
"daily_limit": 500,
"sent_today": 112,
"price_per_email": 0.01,
"dedicated": {
"status": "active",
"daily_volume": 400,
"ready_per_day": 0,
"price_per_period": 200,
"period_start": "2026-11-21T10:02:00.000Z",
"period_end": "2026-12-21T10:02:00.000Z",
"renews": true,
"grace_until": null
},
"commitments": [
{
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"emails": 1500,
"emails_sent": 620,
"held": 26.4,
"due_at": "2026-12-14T08:40:00.000Z"
}
]
}
},
"notice": null,
"usage": {
"cost": 200,
"breakdown": [
{
"unit": "email_dedicated_domain",
"records": 8,
"already_paid": 0,
"cost": 200
}
],
"balance": 248.08,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。