API 参考
会话POST

标记会话已读

把会话标记为已读。conversation_id 通过 JSON body 传入(不走 path,因为渠道侧 ID 可能含 @ / : 等字符)。WhatsApp 消息级已读需要成对传入 up_to_message_id 与 up_to_message_sender_id;群聊发送者使用对应 webhook 的 data.sender.id。省略这两个字段表示把整条会话标记为已读,只传其中一个会返回 400 invalid_request。

https://api.unifyport.ai/v1/accounts/{account_id}/conversations/read

请求头

X-Api-Key
string必填

工作区 API Key,工作区由该请求头解析得到。

Content-Type
string必填

发送 JSON 请求体时使用 application/json。

路径参数

account_id
string必填

用于该 conversations 路由的标识符。

请求体

conversation_id
string必填

目标会话标识。

up_to_message_id
string

要标记已读的最后一条消息,必须与 up_to_message_sender_id 成对传入。

up_to_message_sender_id
string

最后一条消息的发送者,必须与 up_to_message_id 成对传入。

响应体

ok
boolean

操作成功时始终为 true;失败时返回非 2xx 状态码而非该字段。

响应

200
200 OK

请求成功,响应体示例如上。

400
请求错误

请求体、路径或参数不合法。

401
未授权

X-Api-Key 请求头缺失或无效。

404
未找到

未找到请求的渠道资源。

409
冲突

当前操作与已有的渠道账号或资源冲突。

500
服务端错误

服务端遇到了未预期的错误。

501
渠道未实现

所选渠道尚未实现该操作。

502
上游网关错误

渠道适配器或上游渠道未能完成该操作。

请求

curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/conversations/read \
  -H "X-Api-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "conversation_id": "peer_example",
  "up_to_message_id": "msg_example",
  "up_to_message_sender_id": "sender_example"
}'

响应

{
  "data": {
    "ok": true
  }
}