/api/notifications and require authentication.
AI Review supports multiple notification channels: email, Slack, webhook, WeChat Work (企业微信), DingTalk (钉钉), Feishu (飞书), and browser push.
Get notification config
GET /api/notifications/config
Returns the current notification configuration.
200
Create or replace notification config
POST /api/notifications/config
Creates or completely replaces the notification configuration. Requires config:update permission.
200
The saved notification config.
Partially update notification config
PATCH /api/notifications/config
Updates only the provided fields in the notification config. Requires config:update permission.
Send only the fields you want to change. All other fields remain unchanged.
Test a notification channel
POST /api/notifications/config/test-channel
Sends a test notification through the specified channel to verify the configuration is working.
Request body
The channel to test:
email | webhook | slack | wechat | dingtalk | feishu | push.200
Test result details including success status and any error message.
Generate VAPID keys
POST /api/notifications/config/generate-vapid-keys
Generates a new VAPID key pair for use with browser push notifications. Requires config:update permission.
Store the private key securely — it cannot be recovered after leaving this response.
200
List notification history
GET /api/notifications
Returns a paginated list of notification history records.
Page number. Default:
1.Items per page.
Filter by channel:
email | webhook | slack | wechat | dingtalk | feishu | push.Filter by delivery status:
pending | sent | failed.Filter by event type:
review_completed | review_failed | rating_low | daily_summary | weekly_summary.Filter by review UUID.
ISO 8601 start date.
ISO 8601 end date.
200
Get a notification history record
GET /api/notifications/history/:id
Notification history record ID.
200
Single notification history record.
Get notification statistics
GET /api/notifications/stats
Returns delivery statistics aggregated by channel and status.
ISO 8601 start date for the statistics window.
ISO 8601 end date for the statistics window.
200
Aggregated notification statistics.
Get pending notifications
GET /api/notifications/pending
Returns all notifications currently in pending status (awaiting delivery).
Get failed notifications
GET /api/notifications/failed
Returns all notifications with failed delivery status.
Clean old notifications
POST /api/notifications/clean
Deletes notification history records older than the specified number of days. Requires notification:delete permission.
Request body
Delete records older than this many days.
200
Number of records deleted.
Push subscription management
Subscribe to push notifications
POST /api/notifications/push/subscribe
Registers a browser push subscription endpoint.
Request body
The push subscription endpoint URL from the browser.
List all push subscriptions
GET /api/notifications/push/subscriptions
Returns all registered push subscriptions.
Get push subscriptions for a user
GET /api/notifications/push/users/:userId
User ID whose subscriptions to retrieve.
Update subscription last-used timestamp
POST /api/notifications/push/touch
The push subscription endpoint to update.
Unsubscribe from push notifications
DELETE /api/notifications/push/unsubscribe
The push subscription endpoint to remove.
Clean expired push subscriptions
POST /api/notifications/push/clean
Deletes all expired push subscriptions. Requires notification:delete permission.