API 参考 / notifications

标记通知已读

POST /api/v1/notifications/read · markNotificationsRead

把当前登录用户的通知标记为已读。传 ids 只标记指定通知;all=true 标记该用户全部未读为已读(ids 忽略)。 只能改自己的通知(actor 来自 session);对他人的通知 id 无效果,不报错。返回操作后该用户的未读总数。

鉴权:项目 API Token(Authorization: Bearer wfp_…)。详见 Agent 接入。

请求体

ids
string[] —— 要标记为已读的通知 id;all=true 时忽略。
all
boolean —— 为 true 时标记当前用户全部未读为已读(ids 忽略)。

响应字段 · 200

unreadCount(必填)
integer —— 操作后该用户的未读通知总数。

错误

请求示例(curl)

curl -X POST "https://你的项目.workflow.games/api/v1/notifications/read" \
  -H "Authorization: Bearer wfp_…" \
  -H "content-type: application/json" \
  --data '{"ids":["018f3c2e-0000-7000-8000-000000000000"],"all":true}'

响应示例

HTTP/1.1 200
{
  "unreadCount": 1
}

合同真值:OpenAPI 3.1(0.1.0)。

相关:Agent 接入指南 · 使用指南 · API 参考索引

Workflow 正在加载…