Skip to main content
Version: v1 (Current)

Attendee Notification Inbox

The attendee inbox reads stored database notifications for the signed-in attendee. It is separate from email/SMS delivery logs, browser push subscriptions and administrator notifications. Marking an inbox row read records application state; it does not prove someone understood the content or received a provider delivery.

Session and project context​

Use the attendee's existing login on the intended portal host and its same-origin /api/v1 path. These handlers resolve Auth::guard('portal') and require an Attendee. A project key, reader credential or administrator login is not a substitute. The route removes auth:sanctum; that does not make the inbox anonymous. Missing attendee identity returns 401 with status: "unauthenticated" and a message.

Use team/project slugs in /api/v1/projects/{teamSlug}/{projectSlug}/notifications. The portal route stack starts the session and resolves portal/page/project context; applicable permission/page checks can also reject a request. Reuse the normal portal integration's context rather than guessing cookie names or transferring session credentials to another host. See Portals Domains and Authentication.

Every controller query starts from that attendee's notification relation, excluding other attendees' and administrators' rows. The controller does not itself compare the attendee's project with the route's project; URL context alone is not a proven project-isolation boundary. Verify wrong-project/page requests in your consuming environment before relying on that isolation.

List messages and unread counts​

GET the base path with optional page, per_page and unread query parameters. per_page defaults to 25 and is clamped to 1–100. Set unread=1 to list only unread rows. The paginated JSON contains data, pagination links/meta, and meta.unread_count. That count is the attendee's total unread inbox count, not the current page length.

Each row includes id, channel, title, body, action_url, icon_url, read_at and created_at. Missing payload fields can be null. Retain the returned notification ID as a string. Render message text using your normal safe text handling and validate action destinations before navigation.

This read-only browser example runs within an already authenticated portal page; replace the slugs:

const response = await fetch(
'/api/v1/projects/TEAM_SLUG/PROJECT_SLUG/notifications?unread=1&per_page=25',
{credentials: 'same-origin', headers: {Accept: 'application/json'}},
);
if (!response.ok) throw new Error(`Inbox request failed: ${response.status}`);
const inbox = await response.json();
// Display inbox.data and use inbox.meta.unread_count for the total badge count.

A separate GET {base-path}/unread-count returns a direct object:

{
"unread": 3
}

List/count are separate requests; concurrent incoming/read changes can make their results differ. Offline cached reads can also be stale. Refresh online after an acknowledged change instead of treating cached badge state as current server truth.

Mark read and verify persistence​

POST {base-path}/read-all marks the attendee's currently unread rows and returns a direct object:

{
"status": "read",
"marked": 3
}

marked is the number updated, which can be zero. It is not a provider delivery or comprehension count. This is a real write across the current attendee's unread inbox; present an intentional user action and refresh afterward.

Mark-one source limitation​

The registered POST {base-path}/{id}/read intends to mark one owned notification and return status: "read" with read_at. Unknown/foreign IDs are looked up through the attendee relation and return 404 when not found.

The reviewed handler has a parameter-order mismatch: the route provides team slug, project slug, then notification ID, while the method declares notification ID first. Laravel's reviewed controller dispatch passes route values positionally. The handler can consequently look up the team slug instead of the supplied notification ID and return 404 even for a valid owned row. Do not rely on mark-one until that implementation is corrected and its actual route is tested. A successful direct method test would not resolve route dispatch. This documentation does not change the platform handler.

Do not replace an intended single-row update with read-all merely to bypass this issue; it changes a broader set of records. Preserve the user's intent and report the failed action.

Acceptance and troubleshooting​

In an approved test attendee account with test notifications, check list pagination, unread filtering, total count and exclusion of another attendee/admin's IDs. Verify guest/reader/key/admin-only and wrong-project/page requests do not return protected inbox data. After the mark-one fix, test the real project-prefixed route, read back the same row and confirm other unread rows remain unread. Test read-all separately against a deliberately chosen test inbox. No notification or read state is changed by the examples above.

SymptomCheck
401Actual attendee session on the portal host; a bearer key alone is insufficient.
403/404 before handlerPortal/page/project context and applicable middleware checks.
Valid row gives mark-one 404Known handler argument-order mismatch; verify a deployed fix and actual route, rather than retrying broad writes.
Badge differs from page lengthTotal unread count versus page/filter population, concurrent changes or cached responses.
Read state appears unchangedWrite response, online refresh, returned row/count and session identity.
Message absent despite email/push deliveryStored attendee database notifications and provider/browser delivery are distinct channels.

The REST reference describes these registered operations and the mark-one limitation. Source reconciliation is at platform 280cb4c498d70c7e5fcb722d479a9e296e63d31b; schema/example checks are separate from real-route, cross-project and session/cache acceptance.