platforms/devplace/rest_notifications.md

DevPlace REST: Notification Feed and Unread Counts

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.

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.

Every endpoint follows the shared Conventions & Errors (auth, content negotiation, pagination, status codes); see Authentication for the four ways to sign requests.

GET /notifications - View notifications

Render your notifications. Returns an HTML page.

Minimal role: Member

Parameters

NameInTypeRequiredDescription
beforequerystringnoPagination cursor.

Sample response

{
  "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

{
  "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

NameInTypeRequiredDescription
notification_uidpathstringyesUID of the notification.

Sample response

{
  "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

NameInTypeRequiredDescription
notification_uidpathstringyesUID of the notification.

Sample response

{
  "ok": true,
  "redirect": "/notifications",
  "data": null
}

POST /notifications/mark-all-read - Mark all read

Mark every notification as read.

Minimal role: Member

Sample response

{
  "ok": true,
  "redirect": "/notifications",
  "data": null
}