跳到正文
Won.dev
冷邮件 API

添加禁发条目

把邮箱地址或公司域名加入禁发名单。免费。

POST https://api.won.dev/v1/email/suppressions

把邮箱地址或整个公司域名加入你的禁发名单:老客户、竞争对手、在其他渠道要求过不要联系的人。从下一封邮件起生效,对所有发送活动都有效,包括正在运行的活动;带 tenant_id 时只对该租户的发送活动生效。重复添加不会产生变化。单次最多 1000 个地址和 100 个域名。测试 key 有独立的名单,不影响正式的发送活动。免费。

  • 计费: 免费。

参数

参数放在 JSON 请求体里。POST 请求还支持 Idempotency-Key 请求头,见重复请求。

参数类型必填说明(API 原文)
emailsstring[]否Addresses never to write to, such as lee.park@coastal-office.example.
domainsstring[]否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_idstring否Hold them back from this tenant's campaigns only, such as cus_4821. Without it, from all of yours.

响应

错误说明见错误码。

字段类型说明(API 原文)
dataobjectWhat became of the entries.
data.addedintegerEntries that are new on the list.
data.already_listedintegerEntries that were on the list already.
data.rejectedobject[]Entries that were not added, each with the reason.
data.rejected[].valuestring
data.rejected[].messagestring
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue 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_...)发送这个请求,会在沙箱中运行:不发信,不收费。

本页内容