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

修改会话

把会话标为已读或未读、已处理或移回收件箱,和在控制台里操作一样。免费。

把会话标为已读或未读(read),或者标为已处理、移回收件箱(done),对账户里的所有人都生效:控制台也会显示。标为已处理会把会话放进 done 并标为已读,直到之后的回复把它移出来。done: false 会把会话移回收件箱,并一直留在那里,直到被回复或再次标为已处理;即使它已经回复过,或者最后一条回复不需要任何人回,也是这样。回复会话会自动把它移到 done:这个接口是给那些不需要你回复的会话用的。对方还没回信的会话不在任何文件夹里,标记它会返回 invalid_state。免费。

  • 计费: 免费。

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

PATCH
/conversations/{id}

鉴权

apiKey
headerAuthorizationBearer <API key>

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

路径参数

id*string

Conversation ID, such as cnv_9x7p1q8w3e5r4k2m.

长度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
read?boolean

true marks it read, false unread.

done?boolean

true files it under done and marks it read. false moves it back to the inbox, where it stays until it is answered or marked done again.

响应体

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/conversations/cnv_9x7p1q8w3e5r4k2m' \  -H 'Content-Type: application/json' \  -d '{  "id": "cnv_9x7p1q8w3e5r4k2m",  "done": true}'
响应示例
{  "data": {    "id": "cnv_9x7p1q8w3e5r4k2m",    "channel": "email",    "folder": "done",    "unread": false,    "answered": false,    "name": "Dana Whitfield",    "company": "Harborline Imports",    "country": "US",    "campaign": {      "id": "cmp_7p1q8w3e5r4k2m9x",      "name": "US chair importers, November"    },    "replies": 1,    "last_reply": {      "id": "rpl_1q8w3e5r4k2m9x7p",      "intent": "interested",      "automated": false,      "text": "Hi, yes, please send the price list. We are reviewing suppliers for next quarter.",      "has_attachments": false,      "received_at": "2026-11-20T13:41:02.000Z"    },    "activity_at": "2026-11-20T13:41:02.000Z",    "email": {      "recipient_id": "rcp_9x7p1q8w3e5r4k2m",      "address": "dana.whitfield@harborline-imports.example",      "status": "replied",      "reply_from": "dana.whitfield@harborline-imports.example",      "subject": "Re: Office chairs for Harborline Imports"    }  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}

最后更新于