冷邮件 API
添加禁发条目
把邮箱地址或公司域名加入禁发名单。免费。
POST https://api.won.dev/v1/email/suppressions
把邮箱地址或整个公司域名加入你的禁发名单:老客户、竞争对手、在其他渠道要求过不要联系的人。从下一封邮件起生效,对所有发送活动都有效,包括正在运行的活动;带 tenant_id 时只对该租户的发送活动生效。重复添加不会产生变化。单次最多 1000 个地址和 100 个域名。测试 key 有独立的名单,不影响正式的发送活动。免费。
- 计费: 免费。
参数
参数放在 JSON 请求体里。POST 请求还支持 Idempotency-Key 请求头,见重复请求。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
emails | string[] | 否 | Addresses never to write to, such as lee.park@coastal-office.example. |
domains | string[] | 否 | Company domains never to write to, such as coastal-office.example: every address at them is left out. Mail services such as gmail.com cannot be suppressed as a whole. |
tenant_id | string | 否 | Hold them back from this tenant's campaigns only, such as cus_4821. Without it, from all of yours. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object | What became of the entries. |
data.added | integer | Entries that are new on the list. |
data.already_listed | integer | Entries that were on the list already. |
data.rejected | object[] | Entries that were not added, each with the reason. |
data.rejected[].value | string | |
data.rejected[].message | string | |
notice | string | null | A plain sentence when there is something to know about this answer. Null otherwise. |
usage | object | Nothing is charged here. The balance, for reference. |
usage.cost | number | What this call 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/suppressions \
-H "Authorization: Bearer $WON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"emails": [
"lee.park@coastal-office.example"
],
"domains": [
"brightdesk.example"
]
}'{
"data": {
"added": 2,
"already_listed": 0,
"rejected": []
},
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。