--- title: "DevPlace REST: Notification Feed and Unread Counts" description: "Reading the notification feed with cursor pagination, the unread-count endpoint that backs the navigation badges, and the mark-read actions, including per-type coverage and JSON payload shapes." language: null framework: null category: api_design tags: - devplace - api - http-api - notifications - rest - pagination - unread-counts - json-api keywords: - devplace GET /notifications json - devplace unread notification count endpoint - devplace mark notifications read api last_updated: 2026-08-12 difficulty: beginner version: "DevPlace (devplace.net), documented 2026-08" related: - rest_web_push.md - conventions_and_errors.md - authentication.md - README.md search_priority: normal status: published --- # DevPlace REST: Notification Feed and Unread Counts Read your notification feed and mark items read. The unread counts endpoint backs the badges in the navigation bar. Deliver these to the browser with [Web Push](rest_web_push.md). Every endpoint follows the shared [Conventions & Errors](conventions_and_errors.md) (auth, content negotiation, pagination, status codes); see [Authentication](authentication.md) for the four ways to sign requests. ## `GET /notifications` - View notifications Render your notifications. Returns an HTML page. *Minimal role:* Member **Parameters** | Name | In | Type | Required | Description | |------|----|------|----------|-------------| | `before` | query | string | no | Pagination cursor. | **Sample response** ```json { "notification_groups": [ { "label": "string", "entries": [ { "notification": { "uid": "UID", "type": "string", "message": "string", "read": false, "related_uid": "UID", "target_url": "/path", "created_at": "2026-01-01T00:00:00+00:00" }, "actor": { "uid": "UID", "username": "username", "avatar_seed": "string", "bio": "text", "location": "string", "git_link": "string", "website": "string", "level": 0, "xp": 0, "xp_progress_pct": 0, "xp_next_level": 0, "stars": 0, "created_at": "2026-01-01T00:00:00+00:00", "last_seen": "string" }, "time_ago": "2 hours ago" } ] } ], "next_cursor": "2026-01-01T00:00:00+00:00" } ``` ## `GET /notifications/counts` - Unread counts Unread notification and message counts. *Minimal role:* Public > Guests receive `{ "notifications": 0, "messages": 0 }` instead of an error, so the navigation badge works before login. **Sample response** ```json { "notifications": 2, "messages": 1 } ``` ## `GET /notifications/open/{notification_uid}` - Open a notification Mark a notification read and redirect to its target. *Minimal role:* Member **Parameters** | Name | In | Type | Required | Description | |------|----|------|----------|-------------| | `notification_uid` | path | string | yes | UID of the notification. | **Sample response** ```json { "ok": true, "redirect": "/posts/POST_SLUG#comment-COMMENT_UID", "data": null } ``` ## `POST /notifications/mark-read/{notification_uid}` - Mark one read Mark a single notification as read. *Minimal role:* Member **Parameters** | Name | In | Type | Required | Description | |------|----|------|----------|-------------| | `notification_uid` | path | string | yes | UID of the notification. | **Sample response** ```json { "ok": true, "redirect": "/notifications", "data": null } ``` ## `POST /notifications/mark-all-read` - Mark all read Mark every notification as read. *Minimal role:* Member **Sample response** ```json { "ok": true, "redirect": "/notifications", "data": null } ```