冷邮件 API
完整会话
与某人的全部往来邮件,按时间顺序排列,每封都带全文。免费。
GET https://api.won.dev/v1/email/recipients/{id}/conversation
查看某个发送活动中与某人的全部往来邮件,按时间正序排列,每封都带全文:已发出的每一步、对方的回复(包括其同事的回复)、你的回复,以及单独发送的邮件。回复会附带附件和下载链接。给对方写信前,可以先用它了解来龙去脉。最多返回最近 100 封;如果还有更早的邮件,truncated 为 true。免费。
- 计费: 免费。
参数
id 放在路径中,其余参数放在查询字符串里,多个值用英文逗号分隔。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
id | string | 是 | Recipient ID, such as rcp_9x7p1q8w3e5r4k2m. |
响应
错误说明见错误码。
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object | The recipient, and every email between you and them. |
data.recipient | object | |
data.recipient.id | string | Recipient ID, such as rcp_9x7p1q8w3e5r4k2m. |
data.recipient.campaign_id | string | |
data.recipient.email | string | |
data.recipient.first_name | string | null | |
data.recipient.last_name | string | null | |
data.recipient.company | string | null | |
data.recipient.country | string | null | ISO 3166-1 alpha-2, as given or as read off the address. |
data.recipient.contact_id | string | null | The person ID it was added by. |
data.recipient.status | verifying | scheduled | active | replied | completed | bounced | unsubscribed | suppressed | invalid | stopped | verifying while the address is checked, scheduled before the first email, active between emails. Final: replied, completed (every email sent, no answer), bounced, unsubscribed, suppressed, invalid, stopped. |
data.recipient.reason | string | null | Why, for invalid, stopped, bounced and suppressed. |
data.recipient.risky | boolean | The address could not be confirmed: its domain accepts mail for any name. |
data.recipient.emails_sent | integer | |
data.recipient.next_send_at | string | null | When the next email is due at the earliest. |
data.recipient.last_sent_at | string | null | |
data.recipient.metadata | object | Your own keys and values, as you gave them. Empty when none were. |
data.recipient.created_at | string | When it was added, as an ISO 8601 time in UTC. |
data.messages | object[] | The emails, oldest first. |
data.messages[].type | sent | received | sent for an email to them, received for one from them or a colleague. |
data.messages[].at | string | When it was sent or arrived, as an ISO 8601 time in UTC. |
data.messages[].message | object | null | With sent: the email. Null otherwise. |
data.messages[].message.id | string | Message ID, such as msg_3e5r4k2m9x7p1q8w. |
data.messages[].message.campaign_id | string | |
data.messages[].message.recipient_id | string | |
data.messages[].message.to | string | |
data.messages[].message.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.messages[].message.step | integer | null | The step, counted from 1. Null for a reply or a single email. |
data.messages[].message.version | integer | Which version of the step went out, counted from 1. |
data.messages[].message.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.messages[].message.subject | string | |
data.messages[].message.opens | integer | Opens that look like a person's. Machines that fetch mail to scan it are left out. |
data.messages[].message.clicks | integer | |
data.messages[].message.bounce_type | hard | soft | null | |
data.messages[].message.cost | number | What it cost, in US dollars. 0 after a refund. |
data.messages[].message.attachments | object[] | The files that went with it. |
data.messages[].message.attachments[].filename | string | |
data.messages[].message.attachments[].content_type | string | |
data.messages[].message.attachments[].size | integer | In bytes. |
data.messages[].message.sent_at | string | null | |
data.messages[].message.text | string | null | What it said, placeholders filled in, without the footer and the quoted email. |
data.messages[].reply | object | null | With received: the reply. Null otherwise. |
data.messages[].reply.id | string | Reply ID, such as rpl_1q8w3e5r4k2m9x7p. |
data.messages[].reply.campaign_id | string | |
data.messages[].reply.recipient_id | string | |
data.messages[].reply.from_email | string | |
data.messages[].reply.from_name | string | null | |
data.messages[].reply.subject | string | |
data.messages[].reply.text | string | What the person wrote, without the quoted email underneath. |
data.messages[].reply.intent | interested | question | not_interested | wrong_person | unsubscribe | out_of_office | other | What the reply means: interested, question, not_interested, wrong_person, unsubscribe, out_of_office or other. |
data.messages[].reply.confidence | number | How sure the intent is, 0 to 1. Read the text when it is low. |
data.messages[].reply.automated | boolean | An automatic answer, such as an out-of-office note. |
data.messages[].reply.matched_by | thread | address | domain | How it was tied to the recipient: it answers our email, it comes from their address, or from a colleague at the same company. |
data.messages[].reply.has_attachments | boolean | The email came with files. They are listed in attachments within a minute or two of the reply showing up. |
data.messages[].reply.attachments | object[] | The files it came with, in their order. |
data.messages[].reply.attachments[].id | string | Attachment ID, such as att_6m2k9x7p1q8w3e5r. |
data.messages[].reply.attachments[].filename | string | |
data.messages[].reply.attachments[].content_type | string | As the sender's mail program declared it. |
data.messages[].reply.attachments[].size | integer | In bytes. |
data.messages[].reply.attachments[].status | pending | stored | failed | skipped | stored once we have a copy, pending for the minute or two before. skipped files are not copied: programs and scripts (reason: blocked_type) and files over 15 MB (too_large). failed could not be read from the mailbox. |
data.messages[].reply.attachments[].reason | string | null | Why it was skipped or failed. |
data.messages[].reply.attachments[].download_url | string | null | Where to download it, without an API key, for one hour from this response. Null for a skipped or failed file. |
data.messages[].reply.metadata | object | The campaign's metadata with the recipient's over it, as they were when the reply arrived: up to 40 keys. |
data.messages[].reply.received_at | string | When it arrived, as an ISO 8601 time in UTC. |
data.truncated | boolean | Whether there were more than 100 and the oldest were left out. |
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/recipients/rcp_9x7p1q8w3e5r4k2m/conversation" \
-H "Authorization: Bearer $WON_API_KEY"{
"data": {
"recipient": {
"id": "rcp_9x7p1q8w3e5r4k2m",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"email": "dana.whitfield@harborline-imports.example",
"first_name": "Dana",
"last_name": "Whitfield",
"company": "Harborline Imports",
"country": "US",
"contact_id": null,
"status": "active",
"reason": null,
"risky": false,
"emails_sent": 1,
"next_send_at": "2026-11-24T15:20:00.000Z",
"last_sent_at": "2026-11-19T15:07:31.000Z",
"metadata": {
"crm_id": "lead_4471"
},
"created_at": "2026-11-18T14:03:10.000Z"
},
"messages": [
{
"type": "sent",
"at": "2026-11-19T15:07:31.000Z",
"message": {
"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",
"text": "Hi Dana,\n\nI saw that Harborline Imports imports office seating. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\nAlex"
},
"reply": null
},
{
"type": "received",
"at": "2026-11-20T13:41:02.000Z",
"message": null,
"reply": {
"id": "rpl_1q8w3e5r4k2m9x7p",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"recipient_id": "rcp_9x7p1q8w3e5r4k2m",
"from_email": "dana.whitfield@harborline-imports.example",
"from_name": "Dana Whitfield",
"subject": "Re: Office chairs for Harborline Imports",
"text": "Hi, yes, please send the price list. Our spec sheet for the tender is attached.",
"intent": "interested",
"confidence": 0.7,
"automated": false,
"matched_by": "thread",
"has_attachments": true,
"attachments": [
{
"id": "att_6m2k9x7p1q8w3e5r",
"filename": "tender-spec.pdf",
"content_type": "application/pdf",
"size": 248113,
"status": "stored",
"reason": null,
"download_url": "https://won.dev/e/a/eyJhIjoiYXR0XzZtMms5eDdwMXE4dzNlNXIifQ.c2FtcGxl"
}
],
"metadata": {
"customer_id": "c_812",
"crm_id": "lead_4471"
},
"received_at": "2026-11-20T13:41:02.000Z"
}
},
{
"type": "sent",
"at": "2026-11-20T14:02:19.000Z",
"message": {
"id": "msg_9x7p1q8w3e5r4k2m",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"recipient_id": "rcp_9x7p1q8w3e5r4k2m",
"to": "dana.whitfield@harborline-imports.example",
"kind": "reply",
"step": null,
"version": 1,
"status": "sent",
"subject": "Re: Office chairs for Harborline Imports",
"opens": 0,
"clicks": 0,
"bounce_type": null,
"cost": 0.03,
"attachments": [
{
"filename": "price-list.pdf",
"content_type": "application/pdf",
"size": 182344
}
],
"sent_at": "2026-11-20T14:02:19.000Z",
"text": "Hi Dana,\n\nThanks. The price list is attached. Shall I send two samples?\n\nAlex"
},
"reply": null
}
],
"truncated": false
},
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}用测试 key(won_test_...)发送这个请求,会在沙箱中运行:不发信,不收费。