Stats Notifier
API Contract
REST
/api/v1/stats-notifications
6 endpoints
GET
/api/v1/stats-notifications/api/v1/stats-notifications
List current stats notification subscriptions and their time windows
Public
Response Example
{
"data": [
{
"notification_id": "notif_001",
"user_id": "usr_4f8a2c",
"time_window": "quarterly",
"status": "active",
"last_refreshed_at": "2026-03-26T09:45:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/stats-notifications/api/v1/stats-notifications/:notificationId
Get a specific stats notification subscription
Public
Response Example
{
"notification_id": "notif_001",
"user_id": "usr_4f8a2c",
"time_window": "quarterly",
"status": "active",
"last_refreshed_at": "2026-03-26T09:45:00Z",
"snapshot": {
"total_activities": 47,
"completed_activities": 42,
"hours_logged": 128.5
}
}
POST
/api/v1/stats-notifications/api/v1/stats-notifications
Build and activate a stats notification subscription for a user and time window
Public
Request Example
{
"user_id": "usr_4f8a2c",
"time_window": "quarterly"
}
Response Example
{
"notification_id": "notif_002",
"user_id": "usr_4f8a2c",
"time_window": "quarterly",
"status": "active",
"snapshot": {
"total_activities": 47,
"completed_activities": 42,
"hours_logged": 128.5
},
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/stats-notifications/api/v1/stats-notifications/:notificationId
Change the time window for an active stats notification subscription
Public
Request Example
{
"time_window": "monthly"
}
Response Example
{
"notification_id": "notif_001",
"user_id": "usr_4f8a2c",
"time_window": "monthly",
"status": "active",
"updated_at": "2026-03-26T10:02:00Z"
}
DELETE
/api/v1/stats-notifications/api/v1/stats-notifications/:notificationId
Deactivate and remove a stats notification subscription
Public
Response Example
{
"deleted": true,
"notification_id": "notif_001"
}
POST
/api/v1/stats-notifications/api/v1/stats-notifications/:notificationId/refresh
Trigger an immediate stats refresh for an active notification subscription
Public
Response Example
{
"notification_id": "notif_001",
"refreshed": true,
"refreshed_at": "2026-03-26T10:05:00Z",
"snapshot": {
"total_activities": 49,
"completed_activities": 44,
"hours_logged": 133
}
}