Notifications
The notification catalogue rows, delivery channels, routing rules and per-channel attempts.
Tables in this group: attempt, category, channel, device, event, notification, policy, preference, rule, suppression, topic, watermark.
attempt
Delivery-attempt ledger: one row per event per routed channel, inserted before the send so a crash leaves a pending row; retried by the maintenance tick.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Organization the event belongs to; NULL for an instance-scoped event. |
channel_id | uuid | yes | Parent channel row (on delete cascade). |
event_id | uuid | yes | The event row this copy carries; deleting the event at the end of its 30-day retention deletes its copies. |
user_id | uuid | no | The person a personal copy is for, checked again for access before it is sent; NULL for an organization or instance channel. |
device_id | uuid | no | The device a push copy goes to; NULL for every other kind (push is not sent yet). |
topic_code | text | yes | The catalogue topic of the event. |
status | text | yes | pending (default), sent, failed (retry due), abandoned (after 5 attempts) or held (waits for quiet hours or a digest); retries skip held. |
severity | text | yes | info, warning or critical, copied from the event's catalogue definition. |
payload | jsonb | no | Rendered non-secret message as JSON: event, severity, title, body, organizationId, organizationName, targetType, destinationId, context, at. |
attempts | integer | yes | Number of send attempts so far, bumped in SQL by the sender; the row is abandoned once it reaches 5. |
next_attempt_at | timestamp(3) with time zone | no | Earliest time the retry sweep may pick the row up: now plus 2 min grace on insert, then backoff of 1, 5, 25 and 125 min; NULL once sent. |
sent_at | timestamp(3) with time zone | no | When a send succeeded; NULL until then. |
last_error | text | no | Short failure code from the last attempt (http_503, timeout, network, address_scheme_not_https), never a body or the address. |
reason | text | no | Why the copy was held or not sent: quiet_hours, digest, no_access, scope_deleted, read_in_app, unverified, bounced and others; NULL when sent. |
provider_id | text | no | Id the mail queue or push service gave the send, when it gives one; NULL otherwise. |
category
A group of notification topics for the settings screens, written from the code catalogue by the catalog sync in migrate and never deleted.
| Column | Type | Required | Description |
|---|---|---|---|
code | text | yes | Permanent key such as servers or security; a code is never reused with a new meaning. |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
name | text | yes | Group name shown on the settings screens, in book title case. |
position | integer | yes | Sort order on the settings screens, smallest first. |
channel
An address notifications can be delivered to, owned by the instance, one organization or one user per scope; addresses of secret kinds are sealed.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Owning organization, set only when scope is organization and NULL otherwise. |
user_id | uuid | no | Owning user, set only when scope is user; a personal channel follows the user across organizations. |
created_by_user_id | uuid | no | User whose session created the channel (provenance, set NULL on user delete); differs from user_id for org and instance channels. |
kind | text | yes | Transport: email, webhook, slack, discord, telegram or push (push is registered by the store apps, never typed). |
scope | text | yes | Owner kind: instance, organization or user; the owner columns must agree with it (CHECK). |
label | text | yes | Owner-chosen display name such as 'Ops Slack'. |
address | text | yes | Delivery address: plain for email, else a sealed tpsecret envelope (webhook, Slack or Discord URL, Telegram token/chatId, push token). |
signing_secret | text | no | Sealed tpsecret HMAC key for the generic webhook kind (X-TurboPanel-Signature: sha256=...); NULL for other kinds. |
verified_at | timestamp(3) with time zone | no | When the address was confirmed; stamped at creation for own or member emails, NULL means unverified and email delivery is skipped. |
disabled_at | timestamp(3) with time zone | no | Set when the owner pauses the channel; it keeps its rules but receives nothing until resumed. |
digest_cadence | text | no | Email only: hourly or daily batches non-urgent events into one summary per window; NULL sends each event as it happens. |
quiet_start_minute | smallint | no | Quiet hours start as minutes after local midnight (0-1439), set together with quiet_end_minute; NULL means no quiet hours. |
quiet_end_minute | smallint | no | Quiet hours end as minutes after local midnight (0-1439); the window may wrap midnight, and held events go out as one summary when it ends. |
failures | integer | yes | Consecutive failed sends, reset by a success; reserved for pausing a failing shared channel. |
paused_reason | text | no | Why sending stopped: manual, failing or bounced; NULL while the channel sends. |
is_primary | boolean | yes | True for a person's built-in account email channel, which follows their sign-in address and cannot be deleted; one per person. |
is_all_organizations_notified | boolean | yes | Instance channels only: also hear every organization event, including organizations created later; otherwise only install events. |
device
A phone or tablet that can receive push notifications for one person; the table is in place before the push transport, and nothing writes it yet.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
user_id | uuid | yes | Parent user row (on delete cascade). |
name | text | no | What the person calls the device. |
kind | text | yes | ios or android. |
status | text | yes | active (default), paused by the person, or invalid once the push service refused the token. |
provider | text | yes | Push service the token belongs to; expo only for now. |
token | text | yes | Sealed tpsecret push token. |
token_hash | text | yes | SHA-256 of the plain token, unique per provider, so one token belongs to one row although the sealed value varies. |
app_version | text | no | App version the device last registered with. |
locale | text | no | Language tag the device last registered with. |
invalid_reason | text | no | Short error code the push service gave when it refused the token; NULL while the token works. |
last_seen_at | timestamp(3) with time zone | yes | When the app last registered the device; old tokens are retired by a sweep. |
event
One row per thing that happened, the outbox every inbox row and delivery hangs from; scope ids are plain uuids so deletes never touch history.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Organization the event was raised in; NULL for an instance or platform event. |
topic_code | text | yes | The catalogue topic. |
status | text | yes | open, resolved (its recovery event arrived) or closed. |
project_id | uuid | no | Project the event is about, a plain id with no foreign key; a pending copy is dropped once the project is gone. |
environment_id | uuid | no | Environment the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone. |
service_id | uuid | no | Service the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone. |
server_id | uuid | no | Server the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone. |
destination_id | uuid | no | Backup target the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone. |
actor_user_id | uuid | no | Who caused the event, a plain id like audit.actor_user_id; that person is not told unless the topic says so. |
severity | text | yes | info, warning or critical, copied from the topic when the event was raised. |
dedupe | text | no | Key that folds repeats of an open event inside the topic cooldown into one row; NULL means every occurrence is its own event. |
version | integer | yes | Payload version, the topic version when the event was raised. |
repeats | integer | yes | How many repeats were folded into this event inside the cooldown. |
last_seen_at | timestamp(3) with time zone | yes | When the event, or its latest folded repeat, happened. |
fanned_out_at | timestamp(3) with time zone | no | When its inbox rows and deliveries were written; NULL while that is still to do. |
data | jsonb | yes | Small non-secret context the sentences render from, with resource names snapshotted so a deleted resource still reads in words. |
notification
One bell inbox row per event per recipient user, written by emitNotification for every member or manager the event's audience names.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
organization_id | uuid | no | Organization the event belongs to; NULL for an instance-scoped event such as fleet.mass_disconnect. |
user_id | uuid | yes | Recipient of the inbox row; one row per person the event reached, chosen by the event's audience (members or managers). |
topic_code | text | yes | The catalogue topic of the event this row is about. |
severity | text | yes | info, warning or critical, copied from the event's catalogue definition. |
title | text | yes | One-line sentence rendered from the catalogue's title template at emit time; also the email subject. |
body | text | no | Fuller sentence rendered from the catalogue's body template; NULL when the event defines none. |
target_type | text | no | Catalog entity kind the event is about (server, or a grant's entity type) so the bell can link to it; NULL when there is no target. |
target_id | uuid | no | UUID of the target_type entity; not a foreign key, so it may outlive the entity. |
context | jsonb | no | Small non-secret facts the sentence was rendered from, such as serverName, lastSeenAt, count, actorEmail, permissionKey, subjectKind, subjectId. |
read_at | timestamp(3) with time zone | no | When the recipient marked it read (Mark all read); NULL while unread and counted in the badge. |
dismissed_at | timestamp(3) with time zone | no | When the recipient dismissed the row from the bell; NULL while it is still shown. |
event_id | uuid | yes | The event row this copy came from, a plain id with no foreign key so the 90-day inbox outlives the 30-day event retention. |
project_id | uuid | no | Project the event was about, a plain id with no foreign key so the row outlives the project; used for links and filters. |
environment_id | uuid | no | Environment the event was about, a plain id with no foreign key so the row outlives the environment. |
service_id | uuid | no | Service the event was about, a plain id with no foreign key so the row outlives the service. |
server_id | uuid | no | Server the event was about, a plain id with no foreign key so the row outlives the server. |
destination_id | uuid | no | Backup target the event was about, a plain id with no foreign key so the row outlives the target. |
policy
An organization's default notification level for its members or one team, optionally locked; the data model is in place, the screens come later.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | yes | Parent organization row (on delete cascade). |
team_id | uuid | no | Team the default is for; NULL means every member. |
project_id | uuid | no | Project the default is for; a composite key with organization_id proves the project is in that organization, and deleting it deletes the row. |
environment_id | uuid | no | Environment the default is for; a composite key with project_id proves it is in that project, and deleting it deletes the row. |
category_code | text | no | Catalogue category the default is for; NULL with topic_code NULL means every topic. |
topic_code | text | no | One catalogue topic the default is for. |
created_by_user_id | uuid | no | Who set the default; NULL once that account is deleted. |
kind | text | no | Channel kind the default is for: inbox, email, push, chat or webhook; NULL means every kind. |
level | text | yes | all, warning, critical or none. |
is_forced | boolean | yes | True means members cannot override the default. |
preference
One person's notification level for one scope, channel and subject; sparse, most specific row wins, and no row at all means nothing is sent.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Organization the choice is for; NULL means every organization the person belongs to and the install events. |
user_id | uuid | yes | Parent user row (on delete cascade). |
project_id | uuid | no | Project the choice is for; a composite key with organization_id proves the project is in that organization, and deleting it deletes the row. |
environment_id | uuid | no | Environment the choice is for; a composite key with project_id proves it is in that project, and deleting it deletes the row. |
service_id | uuid | no | Service the choice is for; deleting the service deletes the row. |
server_id | uuid | no | Server the choice is for; deleting the server deletes the row. |
destination_id | uuid | no | Backup target the choice is for; deleting the target deletes the row. |
channel_id | uuid | no | One personal channel the choice is for; NULL with kind NULL means every channel. |
category_code | text | no | Catalogue category the choice is for; NULL with topic_code NULL means every topic. |
topic_code | text | no | One catalogue topic the choice is for. |
kind | text | no | Channel kind the choice is for: inbox, email, push, chat (Slack, Discord, Telegram) or webhook; NULL means every kind. |
ends_at | timestamp(3) with time zone | no | A temporary mute or watch: the row stops applying at this time; NULL means it lasts. |
level | text | yes | all, warning (warnings and critical), critical or none. |
rule
Subscription row saying which category or topic (or every topic) reaches a channel at or above a severity floor; a channel with no rule receives nothing.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
organization_id | uuid | no | Organization a shared route belongs to, set with the scope columns that narrow it; NULL means the route covers the whole install. |
channel_id | uuid | yes | Parent channel row (on delete cascade). |
project_id | uuid | no | Project the route is limited to; deleting the project deletes the route. |
environment_id | uuid | no | Environment the route is limited to; deleting the environment deletes the route. |
service_id | uuid | no | Service the route is limited to; deleting the service deletes the route. |
server_id | uuid | no | Server the route is limited to; deleting the server deletes the route. |
destination_id | uuid | no | Backup target the route is limited to; deleting the target deletes the route. |
category_code | text | no | Catalogue category the route is limited to; NULL with topic_code NULL means every topic. |
topic_code | text | no | One catalogue topic the route is limited to; NULL means the category decides, or every topic when the category is NULL too. |
min_severity | text | yes | Severity floor info (default), warning or critical; delivered only when the event's severity ranks at or above it. |
ends_at | timestamp(3) with time zone | no | A muted route sends nothing until this time; NULL means not muted. |
is_enabled | boolean | yes | False keeps the route and sends nothing through it. |
suppression
An email address no notification is sent to because it bounced or was refused, keyed by a hash so the address is never stored here.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
address_hash | text | yes | SHA-256 hex of the trimmed, lower-cased address; one active row per address. |
reason | text | yes | bounced, complained or rejected (the provider refused the recipient for good). |
source | text | yes | Mail path that reported it: smtp, mailgun, mailpit or manual. |
cleared_at | timestamp(3) with time zone | no | When the address was confirmed again; NULL while it is suppressed. |
topic
One row per notification event type, upserted from events.ts by the catalog sync in migrate; a code that leaves the code base gets deprecated_at.
| Column | Type | Required | Description |
|---|---|---|---|
code | text | yes | Permanent event code such as server.offline; preferences, events and history name it, so it is never reused. |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
category_code | text | yes | The category the topic is listed under. |
resolves_code | text | no | The topic this one resolves, such as a recovery naming the failure it ends; NULL for most topics. |
name | text | yes | What a person picks the topic by on the settings screens. |
kind | text | yes | organization (raised in an organization), platform (vendor notices), instance (for administrators) or account (one sign-in). |
severity | text | yes | info, warning or critical; a preference level is a floor compared against it. |
scope | text | no | For an organization topic, the most specific resource it names: organization, project, environment, service, server or destination. |
audience | text | yes | Who may hear it, checked again at send time: members of the organization, its managers (own or manage grants), or admins of the install. |
channels | text[] | yes | Channel kinds the topic may use, a subset of inbox, email, push, chat and webhook. |
level | text | yes | Level used when no preference applies; none for every topic, so nothing arrives until a person turns it on. |
cooldown | interval | yes | How long a repeat of an open event with the same dedupe key is folded into it rather than sent again; zero means never. |
version | integer | yes | Version of the payload shape in event.data. |
deprecated_at | timestamp(3) with time zone | no | When the code left the code base; old rows keep naming it and no new events use it. |
is_urgent | boolean | yes | True when quiet hours and digests never hold it; this is timing only, a person can still turn it off. |
is_actor_notified | boolean | yes | False means the person who caused the event is never told about it. |
watermark
Mark-all-read without rewriting rows: one per person and organization, and inbox rows created at or before read_through read as read.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Organization the mark covers; NULL means every organization and the install events. |
user_id | uuid | yes | Parent user row (on delete cascade). |
read_through | timestamp(3) with time zone | yes | Inbox rows created at or before this time read as read. |
Last updated on