/me/webhooks)可订阅的同样 5 个事件,
也会在这里累积用于应用内展示,除非你把它们静音了。免费。
要 push 式消费,优先用 webhooks —— 这个端点是轮询
回退(比如不方便跑 webhook 接收器的 IDE 扩展或状态栏)。
端点家族
| Method | Path | 用途 |
|---|---|---|
GET | /api/v1/me/notifications?unread=&type=&page=&page_size= | 列出通知 |
GET | /api/v1/me/notifications/unread-count | 只取未读数 |
POST | /api/v1/me/notifications/:id/mark-read | 单条标为已读 |
POST | /api/v1/me/notifications/mark-all-read | 把所有未读标为已读 |
List
Query 参数
| Param | Type | Notes |
|---|---|---|
unread | bool | true 只返回未读行。与 read 互斥。 |
read | bool | true 只返回已读行。 |
type | string | 按事件类型过滤(见 事件目录)。 |
page | integer | 默认 1。 |
page_size | integer | 默认 50,最大 200。 |
Response
Response 字段
| Field | Type | Notes |
|---|---|---|
items[].type | string | 5 个用户可见事件之一(见 事件目录)。 |
items[].title | string | 铃铛下拉里的单行摘要。 |
items[].body | string | 一段描述。 |
items[].link | string | null | 点击跳转的 console 相对深链。 |
items[].read_at | string | null | 用户打开的 ISO 时间戳。null = 未读。 |
total | integer | 匹配过滤的总数(与 page 无关)。unread=true 时也是未读总数。 |
未读计数
标单条为已读
read_at 不变)。
全部标为已读
{"marked_read": 0}。
事件目录 [#event-catalog]
通知 feed 只展示用户可见事件 —— 是 webhook 事件目录 的精选子集。5 个类型:| Type | 何时触发 |
|---|---|
system.payment.received | 一笔充值进入你的钱包 |
system.balance.notify.dispatched | 低余额 cron 跨过你的阈值 |
admin.org.member.add | 有人被加入你的组织(对组织 owner/admin 可见) |
admin.api_key.revoke | 平台管理员撤销了你的个人 key |
org.api_key.revoke | 组织管理员撤销了你的某把组织 key |
错误
| Status | error.type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | 同时给 read=true 和 unread=true,或 type 未知。 |
| 401 | authentication_error | key 缺失 / 已撤销。 |
| 404 | not_found_error | 通知 :id 不属于调用方。 |