Notification reference
2 pages, 19 routes, 19 connections and 2 CLI commands, generated from the declarations of Notification without reading storage or running anything.
Code · 0 files
No ingested source sits in a crate named for this app. Either its crate has not been ingested, or the app's name does not match its crate.
Pages · 2
| Page | View id | Role | Route | Order | Parent | Entity | Navigation |
|---|---|---|---|---|---|---|---|
| List | notification.index | list | /view/notification/list | 0 | Notification | in navigation | |
| List | notification.index | /view/notification/inbox | in navigation |
Connections · 19
Notification.Create
Create a new notification (inbox + optional push). Persists a row in `notification_runtime` and broadcasts on `notification.created`.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| title | required |
- Output keynotification.result
- Classificationreal
- POST /notificationHTTP route
- notification createCLI command
Notification.Demo.Email
Zero-input demo: fires a canned channel=email notification to the local peer rendered through the canonical email template. Uses `CRE8_DEMO_EMAIL` env var as the recipient address (default `demo@cre8.local`). Delivery requires PROVIDER_SENDGRID_API_KEY + PROVIDER_SENDGRID_FROM_EMAIL; without them the send fails visibly, because messaging's provider auto-select refuses to fall back to the mock. Pass payload.provider='mock' to absorb it offline.
- Output keynotification.result
- Classificationreal
- POST /notification/demo/emailHTTP route
Notification.Demo.Push
Zero-input demo: fires a canned channel=push notification to the local peer through the full builder + delivery loop. No subscription enrolled → returns `unreachable` with a diagnostic so the demo confirms the wire path. Subscription enrolled → fans out via the webpush provider stub which logs the would-be send.
- Output keynotification.result
- Classificationreal
- POST /notification/demo/pushHTTP route
Notification.Demo.Sms
Zero-input demo: fires a canned channel=sms notification to the local peer rendered through the canonical SMS template (≤2 segments). Uses `CRE8_DEMO_SMS_TO` env var as the recipient phone (E.164 format like +15551234567); default is the RFC-5612 reserved test line +15555550100 so unconfigured demos fail visibly at Twilio's API rather than text a stranger. Real delivery requires PROVIDER_TWILIO_ACCOUNT_SID + PROVIDER_TWILIO_AUTH_TOKEN + PROVIDER_TWILIO_FROM_NUMBER.
- Output keynotification.result
- Classificationreal
- POST /notification/demo/smsHTTP route
Notification.Demo.Voice
Zero-input demo: fires a canned channel=voice notification that issues an outbound Twilio call. The Twilio API is invoked with a `Url` pointing at this runtime's /messaging/twiml/{call_id} endpoint; when the call connects, Twilio fetches that URL and we reply with a TwiML <Say>+ <Hangup> driving the playback. Recipient = CRE8_DEMO_VOICE_TO env var (E.164, default +15555550100 — RFC-5612 reserved test line). Requires PROVIDER_TWILIO_ACCOUNT_SID + PROVIDER_TWILIO_AUTH_TOKEN + PROVIDER_TWILIO_FROM_NUMBER + CRE8_MESSAGING_BASE_URL set to a publicly reachable URL (e.g. an ngrok tunnel or production hostname); otherwise Twilio's Calls.create fails visibly. Set CRE8_MESSAGING_DETECT_VOICEMAIL=true to opt into machine detection and voicemail-leave branching.
- Output keynotification.result
- Classificationreal
- POST /notification/demo/voiceHTTP route
Notification.Dismiss
Dismiss a notification — mutates row status to `dismissed`. Removes from inbox surfacing.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| id | required |
- Output keynotification.result
- Classificationreal
- POST /notification/dismissHTTP route
Notification.DrainDue
Deliver the scheduled sends that have come due (held at create because `deliver_after` was in the future) through the same messaging path an immediate notification takes. Each item is claimed once, then marked `sent` or `failed` with its delivery report. No HTTP route: the gateway runs it when CRE8_NOTIFICATION_DRAIN_INTERVAL_S > 0.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| limit | optional |
- Output keynotification.result
- Classificationreal
Notification.Due
List notifications whose `deliver_after` has passed but are still pending.
- Output keynotification.result
- Classificationroute_handler
- GET /notification/dueHTTP route
Notification.Get
Fetch a single notification by id.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| id | required |
- Output keynotification.result
- Classificationroute_handler
- GET /notification/detailHTTP route
Notification.Inbox
List inbox notifications for the local peer (with optional limit).
- Output keynotification.result
- Classificationroute_handler
- GET /notificationHTTP route
- GET /notification/inboxHTTP route
- notification inboxCLI command
Notification.PushSubscribe
Enroll a push subscription for the local peer. Three kinds supported via the `kind` field: `web` (browser web-push, requires endpoint + p256dh + auth), `fcm` (Android / Chrome, requires device_token from FCM SDK), `apns` (iOS, requires hex device_token from Apple). Default kind=web for back-compat with N.4 enrollments. Idempotent by endpoint (mobile kinds synthesize an `fcm://<token>` or `apns://<token>` endpoint); re-enrolling the same device updates the row in place. The matching messaging provider (webpush / fcm / apns) sends to each row on channel=push delivery.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| kind | optional | |||
| endpoint | optional | |||
| p256dh | optional | |||
| auth | optional | |||
| device_token | optional | |||
| user_agent | optional | |||
| target_peer_id | optional |
- Output keynotification.result
- Classificationreal
- POST /notification/push-subscribeHTTP route
Notification.PushUnsubscribe
Remove a browser web-push subscription by endpoint. Used when the browser's PushSubscription is revoked or when the user opts out.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| endpoint | required |
- Output keynotification.result
- Classificationreal
- POST /notification/push-unsubscribeHTTP route
Notification.Read
Mark a notification (or list of ids) as read. Mutates the row's status from `pending` → `read`.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| id | required |
- Output keynotification.result
- Classificationreal
- POST /notification/readHTTP route
Notification.Status
Notification subsystem health / counts (pending / read / dismissed).
- Output keynotification.result
- Classificationroute_handler
- GET /notification/statusHTTP route
Notification.Subscribe
Subscribe the local peer to a topic. When any app publishes a notification with this topic (via NotificationBuilder::publish), the subscriber gets fanned out one notification per channel listed on the subscription. Optional `source_app` / `source_id` filters narrow to specific publishers or specific source items. `priority_floor` filters to only notifications at or above the given priority. Channels defaults to ["inbox"]; pass ["inbox","push","email"] to fan out across multiple transports. Idempotent by (peer, topic, source_app, source_id) — re-subscribing the same triple updates channels / floor in place.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| topic | required | |||
| channels | optional | |||
| source_app | optional | |||
| source_id | optional | |||
| priority_floor | optional | |||
| target_peer_id | optional |
- Output keynotification.result
- Classificationreal
- POST /notification/subscribeHTTP route
Notification.Subscriptions
List the local peer's topic subscriptions.
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| target_peer_id | optional |
- Output keynotification.result
- Classificationroute_handler
- GET /notification/subscriptionsHTTP route
Notification.Unsubscribe
Remove a topic subscription — either by `id` (precise) or by `(peer, topic)` (drops every subscription a peer has on that topic regardless of source filters).
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| subscription_id | optional | |||
| topic | optional | |||
| target_peer_id | optional |
- Output keynotification.result
- Classificationreal
- POST /notification/unsubscribeHTTP route
Notification.VapidPublicKey
Return the runtime's VAPID public key (base64url-no-pad uncompressed SEC1 P-256 point). Auto-generated + persisted at notification.boot if not configured via env vars. Browsers pass this to `pushManager.subscribe({ applicationServerKey })`.
- Output keynotification.result
- Classificationroute_handler
- GET /notification/vapid-public-keyHTTP route
Notification.Withdraw
Withdraw notifications before they are delivered or seen, by `id`/`ids` or by `source_app` + `source_id` (+ `topic`). Only pending rows move: `queued`, a held outbound send not yet claimed by a drain pass, or an unread inbox notice; the write is a compare-and-set on the observed status, so a withdrawal and a drain claim never both win. Allowed for the target account, or for the source app's in-process service origin (scope `notification-withdraw`).
| Field | Type | Required | Description | Allowed |
|---|---|---|---|---|
| id | optional | |||
| ids | optional | |||
| source_app | optional | |||
| source_id | optional | |||
| topic | optional | |||
| reason | optional |
- Output keynotification.result
- Classificationreal
- POST /notification/withdrawHTTP route
CLI commands · 2
notification create
Create a local inbox notification
notification create {"title":"Check ballot","body":"Daily position is ready"}notification inbox
List local runtime notifications
notification inbox
Schema and data model
Declared storage and kinds. Linked kinds open their app pages.
- Authoritystateless
- Preferred truthnone
- App ownerNotification
- SQL projectionnone · DDL declarations: 0
- None declared.
- None declared.
- None declared.
- None declared.
- None declared.
- No model warnings were reported.
Capabilities and dependencies
- Truth
- Messaging