通知 API

通知中心 REST API 文档

通知 API

获取通知列表

GET /api/notifications?status=all&source=&page=1&limit=20

参数

参数类型说明
statusstringall / pending / sent / read
sourcestringschedule / ai_message / system
pagenumber页码
limitnumber每页数量

响应

{
  "total": 42,
  "page": 1,
  "limit": 20,
  "notifications": [
    {
      "id": 1,
      "source": "schedule",
      "title": "Mac Mini 01 完成了日报生成",
      "summary": "...",
      "status": "sent",
      "im_channel": "wecom",
      "created_at": "2026-03-15T10:00:00",
      "read_at": ""
    }
  ]
}

批量标记已读

POST /api/notifications/batch-read
Body: { "notification_ids": [1, 2, 3] }
// 或全部标记:
Body: { "all": true }