冷邮件 API
已发邮件列表
已发出的邮件:收件人、步骤和每封的花费。免费。
GET https://api.won.dev/v1/email/messages
列出已发出的邮件,按时间倒序:发给了谁、属于哪一步的哪个版本、是否退信、花了多少钱。打开和点击只在开启追踪的活动中统计。免费。
- 计费: 免费。
参数
参数放在查询字符串里,多个值用英文逗号分隔。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
campaign_id | string | 否 | Only this campaign, such as cmp_7p1q8w3e5r4k2m9x. |
recipient_id | string | 否 | Only emails to this recipient. |
status | sending | sent | bounced | failed | skipped | 否 | Only emails in this status. |
limit | integer | 否 | How many to return, 1 to 100. Default: 25. |
cursor | string | 否 | To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object[] | The emails of this page. |
data[].id | string | Message ID, such as msg_3e5r4k2m9x7p1q8w. |
data[].campaign_id | string | |
data[].recipient_id | string | |
data[].to | string | |
data[].kind | step | reply | single | step of the sequence, reply (your answer to a reply), or single (an email you sent on its own with POST /email/messages). |
data[].step | integer | null | The step, counted from 1. Null for a reply or a single email. |
data[].version | integer | Which version of the step went out, counted from 1. |
data[].status | sending | sent | bounced | failed | skipped | sent, bounced, or sending for the seconds it takes. failed and skipped did not go out and cost nothing. |
data[].subject | string | |
data[].opens | integer | Opens that look like a person's. Machines that fetch mail to scan it are left out. |
data[].clicks | integer | |
data[].bounce_type | hard | soft | null | |
data[].cost | number | What it cost, in US dollars. 0 after a refund. |
data[].attachments | object[] | The files that went with it. |
data[].attachments[].filename | string | |
data[].attachments[].content_type | string | |
data[].attachments[].size | integer | In bytes. |
data[].sent_at | string | null | |
has_more | boolean | Whether more follow this page. |
next_cursor | string | null | Pass it as cursor to get the next page. Null on the last page. |
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/messages?campaign_id=cmp_7p1q8w3e5r4k2m9x&limit=1" \
-H "Authorization: Bearer $WON_API_KEY"{
"data": [
{
"id": "msg_3e5r4k2m9x7p1q8w",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"recipient_id": "rcp_9x7p1q8w3e5r4k2m",
"to": "dana.whitfield@harborline-imports.example",
"kind": "step",
"step": 1,
"version": 1,
"status": "sent",
"subject": "Office chairs for Harborline Imports",
"opens": 0,
"clicks": 0,
"bounce_type": null,
"cost": 0.03,
"attachments": [],
"sent_at": "2026-11-19T15:07:31.000Z"
}
],
"has_more": true,
"next_cursor": "cur_Qm9vVGhpc0lzQVNhbXBsZQ",
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。