冷邮件 API
批准邮件
让等待审批的邮件按原样发出。免费。
批准等待审批(pending_approval)的邮件:每封都按写好的内容,在它的邮箱可以发信、且收件人处于工作时间时尽快发出。没有在等待审批的邮件(例如已经批准过的)保持不变(done: false)。设置为需要审批的 key 不能批准(forbidden):由人在控制台中批准。免费。
- 计费: 调用免费,邮件本身也免费:它们从发件方的发信域名发出,域名按月付费,见发信域名。
用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。
POST
apiKeyheader
AuthorizationBearer <API key>Authorization: Bearer won_live_..., a key from the console.
Idempotency-Key?stringAny unique string. A retry with the same key and the same body returns the first response and is not charged again.
长度
length <= 255application/json- body
message_ids*array<>Up to 100 email IDs, such as msg_3e5r4k2m9x7p1q8w, from GET /email/messages?status=pending_approval.
元素
1 <= items <= 100The result.
application/json- response
data*array<>One result per ID, in the order given.
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 POST 'https://api.won.dev/v1/email/messages/approve' \ -H 'Content-Type: application/json' \ -d '{ "message_ids": [ "msg_3e5r4k2m9x7p1q8w" ]}'响应示例
{ "data": [ { "id": "msg_3e5r4k2m9x7p1q8w", "done": true, "status": "approved" } ], "notice": null, "usage": { "cost": 0, "balance": 48.08, "replayed": false }}最后更新于