Send a test notification to yourself
Access: Bearer token required.
A test/demo helper (labelled as such in the source). It builds an ad-hoc notification object and delivers it as a notification:new event to the caller's own open SSE connections and to their Socket.IO personal room (user:<id>). The recipient is always the token's user; there is no way to target someone else. Nothing is stored: the object is not written to the notifications collection, will not appear in the notifications list, and its id is just notif_<timestamp>. The body is not validated; type defaults to info, metadata is always {} and read is always false. Note the event name is notification:new (singular), distinct from the notifications:new event the real notification service emits. The route is not public, but it is open to any authenticated user regardless of role. The response uses its own envelope, { success, data }.
Auth: this route uses the streamAuth middleware, not authenticateUser (which is why the generated spec shows it as public). It requires a valid access token, taken from Authorization: Bearer <token> or, if that header is absent, from the ?token= query parameter. streamAuth only verifies the JWT signature and expiry: it does not load the user from the database, so it does not notice deleted or deactivated accounts, and it sets the request's role to the placeholder user, so no stream route authorizes on role. Its failures use their own body shape, { success: false, error }, not the standard error envelope.
bearerAuthAuthorizationBearer <JWT>Access token returned by sign-in. Send it as Authorization: Bearer <token>.
token?stringJWT access token, accepted as an alternative to the Authorization: Bearer header.
application/json- body
title?stringNotification title. Not validated; omitted from the payload if not sent.
body?stringNotification text. Not validated; omitted from the payload if not sent.
type?stringFree-form type label. Defaults to info.
Event emitted to the caller's own connections. data is the payload that was sent.
application/json- response
success*booleandata*curl -X POST 'http://localhost:4000/api/v1/stream/notify' \ -H 'Content-Type: application/json' \ -d '{ "title": "Test", "body": "This is a test notification", "type": "info"}'{ "success": true, "data": { "id": "notif_1780668130107", "userId": "665f1c2e9b1d4a0012ab34c4", "title": "Test", "body": "This is a test notification", "type": "info", "metadata": {}, "read": false, "createdAt": "2026-06-05T14:02:10.107Z" }}
HomeLink Hub