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

修改发件方

登记发件方之后,再为更多地区声明合法依据,或修改它的 metadata。免费。

为更多有更严格规定的地区声明给当地的人发信的合法依据,或重新说明某个地区的依据,并替换发件方的 metadata。只修改传入的字段。地区一旦声明就会一直保留:在该地区收进活动的人,正是依据这项声明收进来的。每项声明都会连同时间和发起声明的 key 一起记录,并从之后添加的收件人开始生效。公司名称、地址和网站是每封邮件写明的发件方身份,因此不能修改:为另一家公司发信,请登记新的发件方。免费。

  • 计费: 免费。

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

PATCH
/email/senders/{id}

鉴权

apiKey
headerAuthorizationBearer <API key>

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

路径参数

id*string

Sender ID, such as snd_4k2m9x7p1q8w3e5r.

长度length <= 40

请求头参数

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
regions?array<>

Regions to declare a lawful basis for: each one is added, or replaces the basis given for it before. The others stay as they are.

元素1 <= items <= 3
metadata?

Your own keys and values, such as {"customer_id": "c_812"}: up to 20 keys of at most 40 characters, each value a string of at most 500. It replaces the metadata there is; {} removes it. Events that already happened keep what they carried.

响应体

The result.

application/json
  1. response
data*
notice*|

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

usage*

Nothing is charged here. The balance, for reference.

请求示例
curl -X PATCH 'https://api.won.dev/v1/email/senders/snd_4k2m9x7p1q8w3e5r' \  -H 'Content-Type: application/json' \  -d '{  "id": "snd_4k2m9x7p1q8w3e5r",  "regions": [    {      "region": "uk",      "basis": "Legitimate interest: B2B contacts at companies that import office furniture, in their work role."    }  ]}'
响应示例
{  "data": {    "id": "snd_4k2m9x7p1q8w3e5r",    "company_name": "Northwind Seating Ltd",    "address": "18 Harbour Road, Leeds LS1 4AP, United Kingdom",    "website": "https://northwind-seating.example",    "purpose": "We make office chairs and write to furniture importers and distributors about our new catalogue.",    "status": "active",    "review_note": null,    "throttled": false,    "regions": [      {        "region": "uk",        "basis": "Legitimate interest: B2B contacts at companies that import office furniture, in their work role.",        "declared_at": "2026-11-21T09:30:00.000Z"      }    ],    "metadata": {      "customer_id": "c_812"    },    "test": false,    "created_at": "2026-11-17T09:12:44.000Z"  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}

最后更新于