TurboPanel Docs
Database

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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidnoOrganization the event belongs to; NULL for an instance-scoped event.
channel_iduuidyesParent channel row (on delete cascade).
event_iduuidyesThe event row this copy carries; deleting the event at the end of its 30-day retention deletes its copies.
user_iduuidnoThe person a personal copy is for, checked again for access before it is sent; NULL for an organization or instance channel.
device_iduuidnoThe device a push copy goes to; NULL for every other kind (push is not sent yet).
topic_codetextyesThe catalogue topic of the event.
statustextyespending (default), sent, failed (retry due), abandoned (after 5 attempts) or held (waits for quiet hours or a digest); retries skip held.
severitytextyesinfo, warning or critical, copied from the event's catalogue definition.
payloadjsonbnoRendered non-secret message as JSON: event, severity, title, body, organizationId, organizationName, targetType, destinationId, context, at.
attemptsintegeryesNumber of send attempts so far, bumped in SQL by the sender; the row is abandoned once it reaches 5.
next_attempt_attimestamp(3) with time zonenoEarliest 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_attimestamp(3) with time zonenoWhen a send succeeded; NULL until then.
last_errortextnoShort failure code from the last attempt (http_503, timeout, network, address_scheme_not_https), never a body or the address.
reasontextnoWhy 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_idtextnoId 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.

ColumnTypeRequiredDescription
codetextyesPermanent key such as servers or security; a code is never reused with a new meaning.
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
nametextyesGroup name shown on the settings screens, in book title case.
positionintegeryesSort 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidnoOwning organization, set only when scope is organization and NULL otherwise.
user_iduuidnoOwning user, set only when scope is user; a personal channel follows the user across organizations.
created_by_user_iduuidnoUser whose session created the channel (provenance, set NULL on user delete); differs from user_id for org and instance channels.
kindtextyesTransport: email, webhook, slack, discord, telegram or push (push is registered by the store apps, never typed).
scopetextyesOwner kind: instance, organization or user; the owner columns must agree with it (CHECK).
labeltextyesOwner-chosen display name such as 'Ops Slack'.
addresstextyesDelivery address: plain for email, else a sealed tpsecret envelope (webhook, Slack or Discord URL, Telegram token/chatId, push token).
signing_secrettextnoSealed tpsecret HMAC key for the generic webhook kind (X-TurboPanel-Signature: sha256=...); NULL for other kinds.
verified_attimestamp(3) with time zonenoWhen the address was confirmed; stamped at creation for own or member emails, NULL means unverified and email delivery is skipped.
disabled_attimestamp(3) with time zonenoSet when the owner pauses the channel; it keeps its rules but receives nothing until resumed.
digest_cadencetextnoEmail only: hourly or daily batches non-urgent events into one summary per window; NULL sends each event as it happens.
quiet_start_minutesmallintnoQuiet hours start as minutes after local midnight (0-1439), set together with quiet_end_minute; NULL means no quiet hours.
quiet_end_minutesmallintnoQuiet 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.
failuresintegeryesConsecutive failed sends, reset by a success; reserved for pausing a failing shared channel.
paused_reasontextnoWhy sending stopped: manual, failing or bounced; NULL while the channel sends.
is_primarybooleanyesTrue 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_notifiedbooleanyesInstance 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
user_iduuidyesParent user row (on delete cascade).
nametextnoWhat the person calls the device.
kindtextyesios or android.
statustextyesactive (default), paused by the person, or invalid once the push service refused the token.
providertextyesPush service the token belongs to; expo only for now.
tokentextyesSealed tpsecret push token.
token_hashtextyesSHA-256 of the plain token, unique per provider, so one token belongs to one row although the sealed value varies.
app_versiontextnoApp version the device last registered with.
localetextnoLanguage tag the device last registered with.
invalid_reasontextnoShort error code the push service gave when it refused the token; NULL while the token works.
last_seen_attimestamp(3) with time zoneyesWhen 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidnoOrganization the event was raised in; NULL for an instance or platform event.
topic_codetextyesThe catalogue topic.
statustextyesopen, resolved (its recovery event arrived) or closed.
project_iduuidnoProject the event is about, a plain id with no foreign key; a pending copy is dropped once the project is gone.
environment_iduuidnoEnvironment the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone.
service_iduuidnoService the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone.
server_iduuidnoServer the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone.
destination_iduuidnoBackup target the event is about, a plain id with no foreign key; a pending copy is dropped once it is gone.
actor_user_iduuidnoWho caused the event, a plain id like audit.actor_user_id; that person is not told unless the topic says so.
severitytextyesinfo, warning or critical, copied from the topic when the event was raised.
dedupetextnoKey that folds repeats of an open event inside the topic cooldown into one row; NULL means every occurrence is its own event.
versionintegeryesPayload version, the topic version when the event was raised.
repeatsintegeryesHow many repeats were folded into this event inside the cooldown.
last_seen_attimestamp(3) with time zoneyesWhen the event, or its latest folded repeat, happened.
fanned_out_attimestamp(3) with time zonenoWhen its inbox rows and deliveries were written; NULL while that is still to do.
datajsonbyesSmall 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
organization_iduuidnoOrganization the event belongs to; NULL for an instance-scoped event such as fleet.mass_disconnect.
user_iduuidyesRecipient of the inbox row; one row per person the event reached, chosen by the event's audience (members or managers).
topic_codetextyesThe catalogue topic of the event this row is about.
severitytextyesinfo, warning or critical, copied from the event's catalogue definition.
titletextyesOne-line sentence rendered from the catalogue's title template at emit time; also the email subject.
bodytextnoFuller sentence rendered from the catalogue's body template; NULL when the event defines none.
target_typetextnoCatalog 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_iduuidnoUUID of the target_type entity; not a foreign key, so it may outlive the entity.
contextjsonbnoSmall non-secret facts the sentence was rendered from, such as serverName, lastSeenAt, count, actorEmail, permissionKey, subjectKind, subjectId.
read_attimestamp(3) with time zonenoWhen the recipient marked it read (Mark all read); NULL while unread and counted in the badge.
dismissed_attimestamp(3) with time zonenoWhen the recipient dismissed the row from the bell; NULL while it is still shown.
event_iduuidyesThe 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_iduuidnoProject the event was about, a plain id with no foreign key so the row outlives the project; used for links and filters.
environment_iduuidnoEnvironment the event was about, a plain id with no foreign key so the row outlives the environment.
service_iduuidnoService the event was about, a plain id with no foreign key so the row outlives the service.
server_iduuidnoServer the event was about, a plain id with no foreign key so the row outlives the server.
destination_iduuidnoBackup 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidyesParent organization row (on delete cascade).
team_iduuidnoTeam the default is for; NULL means every member.
project_iduuidnoProject the default is for; a composite key with organization_id proves the project is in that organization, and deleting it deletes the row.
environment_iduuidnoEnvironment the default is for; a composite key with project_id proves it is in that project, and deleting it deletes the row.
category_codetextnoCatalogue category the default is for; NULL with topic_code NULL means every topic.
topic_codetextnoOne catalogue topic the default is for.
created_by_user_iduuidnoWho set the default; NULL once that account is deleted.
kindtextnoChannel kind the default is for: inbox, email, push, chat or webhook; NULL means every kind.
leveltextyesall, warning, critical or none.
is_forcedbooleanyesTrue 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidnoOrganization the choice is for; NULL means every organization the person belongs to and the install events.
user_iduuidyesParent user row (on delete cascade).
project_iduuidnoProject the choice is for; a composite key with organization_id proves the project is in that organization, and deleting it deletes the row.
environment_iduuidnoEnvironment the choice is for; a composite key with project_id proves it is in that project, and deleting it deletes the row.
service_iduuidnoService the choice is for; deleting the service deletes the row.
server_iduuidnoServer the choice is for; deleting the server deletes the row.
destination_iduuidnoBackup target the choice is for; deleting the target deletes the row.
channel_iduuidnoOne personal channel the choice is for; NULL with kind NULL means every channel.
category_codetextnoCatalogue category the choice is for; NULL with topic_code NULL means every topic.
topic_codetextnoOne catalogue topic the choice is for.
kindtextnoChannel kind the choice is for: inbox, email, push, chat (Slack, Discord, Telegram) or webhook; NULL means every kind.
ends_attimestamp(3) with time zonenoA temporary mute or watch: the row stops applying at this time; NULL means it lasts.
leveltextyesall, 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
organization_iduuidnoOrganization a shared route belongs to, set with the scope columns that narrow it; NULL means the route covers the whole install.
channel_iduuidyesParent channel row (on delete cascade).
project_iduuidnoProject the route is limited to; deleting the project deletes the route.
environment_iduuidnoEnvironment the route is limited to; deleting the environment deletes the route.
service_iduuidnoService the route is limited to; deleting the service deletes the route.
server_iduuidnoServer the route is limited to; deleting the server deletes the route.
destination_iduuidnoBackup target the route is limited to; deleting the target deletes the route.
category_codetextnoCatalogue category the route is limited to; NULL with topic_code NULL means every topic.
topic_codetextnoOne catalogue topic the route is limited to; NULL means the category decides, or every topic when the category is NULL too.
min_severitytextyesSeverity floor info (default), warning or critical; delivered only when the event's severity ranks at or above it.
ends_attimestamp(3) with time zonenoA muted route sends nothing until this time; NULL means not muted.
is_enabledbooleanyesFalse 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
address_hashtextyesSHA-256 hex of the trimmed, lower-cased address; one active row per address.
reasontextyesbounced, complained or rejected (the provider refused the recipient for good).
sourcetextyesMail path that reported it: smtp, mailgun, mailpit or manual.
cleared_attimestamp(3) with time zonenoWhen 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.

ColumnTypeRequiredDescription
codetextyesPermanent event code such as server.offline; preferences, events and history name it, so it is never reused.
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
category_codetextyesThe category the topic is listed under.
resolves_codetextnoThe topic this one resolves, such as a recovery naming the failure it ends; NULL for most topics.
nametextyesWhat a person picks the topic by on the settings screens.
kindtextyesorganization (raised in an organization), platform (vendor notices), instance (for administrators) or account (one sign-in).
severitytextyesinfo, warning or critical; a preference level is a floor compared against it.
scopetextnoFor an organization topic, the most specific resource it names: organization, project, environment, service, server or destination.
audiencetextyesWho may hear it, checked again at send time: members of the organization, its managers (own or manage grants), or admins of the install.
channelstext[]yesChannel kinds the topic may use, a subset of inbox, email, push, chat and webhook.
leveltextyesLevel used when no preference applies; none for every topic, so nothing arrives until a person turns it on.
cooldownintervalyesHow long a repeat of an open event with the same dedupe key is folded into it rather than sent again; zero means never.
versionintegeryesVersion of the payload shape in event.data.
deprecated_attimestamp(3) with time zonenoWhen the code left the code base; old rows keep naming it and no new events use it.
is_urgentbooleanyesTrue when quiet hours and digests never hold it; this is timing only, a person can still turn it off.
is_actor_notifiedbooleanyesFalse 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.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
organization_iduuidnoOrganization the mark covers; NULL means every organization and the install events.
user_iduuidyesParent user row (on delete cascade).
read_throughtimestamp(3) with time zoneyesInbox rows created at or before this time read as read.
Edit on GitHub

Last updated on

On this page