Notifications
Notifications are the summaries and alerts Day Planner writes for you — a morning plan, a warning about a deadline at risk. Every endpoint acts only on your own notifications and needs an API key or a signed-in session — see API keys. Requests without one get 401 Unauthorized; error responses carry an error message.
List notifications
Section titled “List notifications”Returns your 50 most recent notifications and your unread count.
GET /api/notificationsIt takes no parameters.
Response
Section titled “Response”200 OK with the notifications and the unread count.
{ "notifications": [ { "id": "d4a7c1e9-6b2f-4d8a-9e5c-0f3b6a2c8d17", "userId": "b1d4e7a0-2c5f-4b8e-9a1d-6c3f0e2b5a78", "type": "morning_summary", "title": "Good morning! Here's your plan for Thursday, 1 October", "body": "3 tasks scheduled. 1 hard-deadline task at risk.", "read": false, "metadata": { "scheduledTasks": 3, "atRiskCount": 1, "atRiskTaskIds": ["c9f2a5d8-3e6b-4a1c-9d7f-2b5e8a0c3f64"] }, "createdAt": "2026-09-30T23:02:10.441Z" } ], "unreadCount": 1}Notifications come newest first; metadata holds whatever the generator recorded, such as the task ids behind an alert.
Errors
Section titled “Errors”- 401 Unauthorized — no valid API key or session.
Generate notifications
Section titled “Generate notifications”Generates a morning summary or an at-risk deadline alert. The scheduler calls this after a run, and you can call it yourself.
POST /api/notificationsThe body picks which one to generate.
Body fields
Section titled “Body fields”| Name | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | morning_summary or at_risk |
morning_summary writes one summary per day in your timezone covering the day’s blocks and at-risk tasks; calling it again on the same day adds nothing. at_risk writes one at_risk_deadline alert listing every task due within 24 hours that has no active time block, and skips tasks an alert already covered in the last six hours.
Response
Section titled “Response”200 OK with what was generated and the new unread count.
{ "generated": 2, "unreadCount": 3}For at_risk, generated counts the tasks the alert covers and is 0 when nothing is new; for morning_summary it is always 1.
Errors
Section titled “Errors”- 400 Bad Request —
typeis missing or neithermorning_summarynorat_risk;detailsnames the fields. - 401 Unauthorized — no valid API key or session.
Mark all notifications as read
Section titled “Mark all notifications as read”Marks every unread notification as read.
PATCH /api/notificationsIt takes no body.
Response
Section titled “Response”200 OK with how many notifications changed.
{ "markedRead": 4 }Only notifications that were unread are counted.
Errors
Section titled “Errors”- 401 Unauthorized — no valid API key or session.
Mark a notification as read
Section titled “Mark a notification as read”Marks a single notification as read.
POST /api/notifications/readThe body names the notification.
Body fields
Section titled “Body fields”| Name | Type | Required | Description |
|---|---|---|---|
notificationId |
string | Yes | The notification’s id |
Response
Section titled “Response”200 OK once the notification is read.
{ "success": true }Calling this for an already-read notification succeeds without changing anything.
Errors
Section titled “Errors”- 400 Bad Request —
notificationIdis missing or not a UUID;detailsnames the fields. - 404 Not Found — no notification of that id belongs to you; the
errormessage isNotification not found. - 401 Unauthorized — no valid API key or session.
Example: generate a morning summary
Section titled “Example: generate a morning summary”Ask for today’s summary straight away.
curl -X POST https://tasks.example.com/api/notifications \ -H "Authorization: Bearer dp_change-me" \ -H "Content-Type: application/json" \ -d '{"type":"morning_summary"}'The response is 200 OK with generated set to 1; read the summary through the List notifications response.
See also
Section titled “See also”- Planner: run the planner before generating at-risk alerts
- run_scheduler: the scheduler run that generates alerts for you
- API keys: authenticate REST calls