冷邮件 API
事件列表
获取上次查询以来发生的事件:回复、退信、退订、活动开始和结束。免费。
GET https://api.won.dev/v1/events
获取上次查询以来发生的事件,按时间正序:收到一条回复、一封邮件退信、一个活动结束等。不用 Webhook 也能跟进进展:把上一次调用返回的 next_cursor 作为 cursor 传入,就能拿到这期间新发生的事件,每个事件只出现一次。与其他列表不同,最后一页也会返回 next_cursor,并且只要事件还在保留期内,它就不会过期。data 为空表示没有新事件,过几分钟再查即可。事件保留 30 天。事件类型:sender.approved、sender.rejected、campaign.started、campaign.paused、campaign.resumed、campaign.completed、campaign.canceled、email.sent、email.opened、email.clicked、email.bounced、reply.received、recipient.unsubscribed、account.suspended、task.completed。免费。
- 计费: 免费。
参数
参数放在查询字符串里,多个值用英文逗号分隔。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
cursor | string | 否 | Only events after the previous call: its next_cursor, passed back unchanged. |
since | string | 否 | Only events after this ISO 8601 time, such as 2026-11-20T13:41:02Z. For the first call, when there is no cursor yet. |
types | (sender.approved | sender.rejected | campaign.started | campaign.paused | campaign.resumed | campaign.completed | campaign.canceled | email.sent | email.opened | email.clicked | email.bounced | reply.received | recipient.unsubscribed | account.suspended | task.completed)[] | 否 | Only these types, such as reply.received,email.bounced. Default: all. |
campaign_id | string | 否 | Only events of this campaign. |
tenant_id | string | 否 | Only events of this tenant: of its senders, its campaigns and their emails, and an account.suspended of the whole account, which stops the tenant too. |
limit | integer | 否 | How many to return, 1 to 100. Default: 50. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object[] | The events, oldest first. |
data[].id | string | Event ID, such as evt_5r4k2m9x7p1q8w3e. Pass the last one as after. |
data[].type | string | What happened, such as reply.received. |
data[].created_at | string | When it happened, as an ISO 8601 time in UTC. |
data[].campaign_id | string | null | |
data[].tenant_id | string | null | The tenant it is about: the tenant_id of the campaign's sender, or of the sender or the sending it is about. Null for the account itself. |
data[].test | boolean | From a test key's sandbox: nothing real happened. |
data[].metadata | object | Your metadata of what it is about, as it was when it happened: the campaign's, with the recipient's over it when it is about a recipient (up to 40 keys then), or the task's. Empty when there is none. |
data[].data | object | The details. Their shape depends on type. |
has_more | boolean | Whether more are waiting. Call again with next_cursor to get them. |
next_cursor | string | null | Pass it as cursor in the next call, now or later. When data is empty it is the cursor you sent, so it can always be passed on. Null only when the call had no cursor and found no events: call again with since. |
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/events?types=reply.received&limit=1" \
-H "Authorization: Bearer $WON_API_KEY"{
"data": [
{
"id": "evt_5r4k2m9x7p1q8w3e",
"type": "reply.received",
"created_at": "2026-11-20T13:44:10.000Z",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"tenant_id": null,
"test": false,
"metadata": {
"customer_id": "c_812",
"crm_id": "lead_4471"
},
"data": {
"reply_id": "rpl_1q8w3e5r4k2m9x7p",
"recipient_id": "rcp_9x7p1q8w3e5r4k2m",
"email": "dana.whitfield@harborline-imports.example",
"from_email": "dana.whitfield@harborline-imports.example",
"subject": "Re: Office chairs for Harborline Imports",
"text": "Hi, yes, please send the price list. We are reviewing suppliers for next quarter.",
"intent": "interested",
"confidence": 0.7,
"automated": false,
"has_attachments": false
}
}
],
"has_more": false,
"next_cursor": "evt_5r4k2m9x7p1q8w3e",
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。