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

修改邮件

修改一封等待审批的邮件,只针对它所写给的那个人。免费。

修改一封等待审批、或已批准但还没发出的邮件的主题或正文,只针对这一个人。它会像每封邮件一样经过检查,然后重新等待审批。请直接写出内容:占位符已经填好了。回复上一封邮件的跟进邮件沿用该线程的主题。之后修改活动的步骤时,这封邮件保持修改后的样子。免费。

  • 计费: 免费。

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

PATCH
/email/messages/{id}

鉴权

apiKey
headerAuthorizationBearer <API key>

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

路径参数

id*string

Email ID, such as msg_3e5r4k2m9x7p1q8w.

长度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
subject?string

The new subject line.

长度1 <= length <= 300
text?string

The new text, as plain text. The footer and the unsubscribe link are added when it goes out.

长度1 <= length <= 4000

响应体

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/messages/msg_3e5r4k2m9x7p1q8w' \  -H 'Content-Type: application/json' \  -d '{  "id": "msg_3e5r4k2m9x7p1q8w",  "text": "Hi Dana,\n\nI saw that Harborline Imports imports office seating, and that you opened a warehouse in Savannah. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\nAlex"}'
响应示例
{  "data": {    "id": "msg_3e5r4k2m9x7p1q8w",    "conversation_id": "cnv_9x7p1q8w3e5r4k2m",    "campaign_id": "cmp_7p1q8w3e5r4k2m9x",    "recipient_id": "rcp_9x7p1q8w3e5r4k2m",    "from": "alex@northwindseating.example",    "to": "dana.whitfield@harborline-imports.example",    "kind": "step",    "step": 1,    "version": 1,    "status": "pending_approval",    "subject": "Office chairs for Harborline Imports",    "text": "Hi Dana,\n\nI saw that Harborline Imports imports office seating, and that you opened a warehouse in Savannah. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\nAlex",    "opens": 0,    "clicks": 0,    "bounce_type": null,    "attachments": [],    "sent_at": null  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}