Skip to Content
Xeonr Developer Docs

Delivery and channels

How a message becomes deliveries, what each channel does, and how to read the ledger.

Publishing does not send anything. It records a message, works out who it reaches and over which channels, and writes one delivery row per (person × channel). A drainer sends those with a lease and a backoff ladder.

That indirection is what makes the ledger honest: every delivery has a state, and you can ask what happened to any message afterwards.

Who a message reaches

Two shapes.

Subscribers — no recipients. Whoever follows the topic, narrowed by each person's own filters. The stream case: ci/builds, a status feed, your phone.

Directed — recipients names people or teams. They receive it whether or not they subscribed, because an event about somebody is not something they signed up for. This is the "your request was approved" case.

{"topicId": "tp_…", "kind": "request.approved",
 "recipients": [
   {"urn": "urn:xeonr:auth:uid:user:42"},
   {"urn": "urn:xeonr:auth:team:59a7308e-…", "role": "admin"}
 ]}

A team recipient is expanded by notify at send time, optionally narrowed to a role. You never enumerate a team yourself, and you do not need to know who administers it.

A directed message also leaves each recipient a subscription on the topic, so there is something for them to mute. Without that, a product could address a team forever and no member would have an off switch. The row follows the event kind's defaults until they change something. Recipients can edit and mute that row even when they have no other access to the topic, and leaving it mutes it rather than deleting it, since the next message would only recreate it.

Addressing somebody by email

Some people a product has to reach have no account notify can resolve: an invitation to somebody who has not signed up, or a person in another organisation. A product's service account may name them by address instead:

{"recipients": [{"email": "[email protected]"}]}

An address gets an email and nothing else: no inbox row, no subscription, no preferences, because there is no identity to hang them on. The ledger names it as mailto:[email protected], and the suppression list still applies. It is only accepted from a product's own service account, on a kind registered in that product's catalogue — a person's token, or an unregistered kind, is refused.

Knowing when somebody could not be reached

A directed publish fans out before it returns, and the response lists any recipient a channel was chosen for that notify had no address for:

{"message": {"id": "msg_…"}, "created": true,
 "unaddressable": ["urn:xeonr:auth:uid:user:42"]}

That is the one failure a publish otherwise reports as a success, so a product that must reach somebody — a password reset — can fall back for exactly those people. A recipient who chose not to hear (a mute, a preference switched off) is not listed: that is the system working, and a fallback would override them. The list is empty for a scheduled message, which has not fanned out yet.

Channels

ChannelWhat it is
in-appThe inbox row. Always written for anybody a message reached.
web pushA browser, via VAPID.
pushA phone, via APNs or FCM. Separate from web push: a laptop and a pocket are different places.
emailThe address on the recipient's Xeonr account — resolved from the account, so a person's first notification reaches them.
DiscordA DM to their linked Discord account, and any channel sink the topic routes to.
webhookAn HTTPS POST to a URL a topic routes to — a sink only, never a person's channel.

The inbox cannot be switched off. It is the delivery record — it is how the ledger names everyone a message reached even when nothing was pushed — so removing it would be a gap in the record rather than a quieter notification. Somebody who does not want a topic mutes or leaves the topic.

Delivery states

StateMeans
pendingQueued, or waiting for its next attempt.
sentAccepted by the far end.
failedPermanently refused, with the reason.
suppressedThe address is on the suppression list, so nothing was attempted.
supersededA later message with the same coalesce key replaced this one before it left.
shadowedThe publishing product is migrating onto notify and still delivers itself: notify wrote what it would have sent, on which channel, and sent nothing. Inbox rows still land.

The last two are states rather than flags because the honest answer to "what happened to this" is neither sent nor failed.

A delivery also carries forced, set when a channel was used despite the recipient not having chosen it, because the event kind is marked critical. An override the ledger cannot show is indistinguishable from a preference that did not work.

Sender profiles

A product that sends on behalf of several tenants — each with its own mail domain and brand — registers a sender profile per tenant: a Mail relay credential owned by the product under its application URN plus /<profile>:

urn:xeonr:auth:application:<id>/org-acme

and names it on each publish with "sender": "org-acme". That message's email leaves through the profile's relay and from address. The relay's optional brand name, link and colour dress the email as the tenant, and the topic is dropped from its header — the reader has never heard of it. A profile that is not registered falls back to the product's own relay, then the topic owner's, then the platform's. Profile names are lower-case letters, digits and -.

Whoever can manage the product's credentials can manage its profiles, including the product's own service account.

Templates and kinds

A product can register a kind catalogue: request.approved belongs to the requests category, defaults to these channels at this priority, and is or is not critical or sensitive. That gives subscribers something coarse to filter on and supplies defaults for a directed message.

Sensitive kinds

Some messages are the secret: a password reset link, a one-time code, an invitation token. A kind marked sensitive (or a single publish with "sensitive": true) keeps that content on the channel it was rendered for and nowhere else:

  • a push carries the title alone and taps into the app — nothing lands on a lock screen that notify cannot take back;
  • the inbox row shows the title and the fact of delivery, with no body;
  • the body, click URL, actions, payload and per-channel renders are never returned over the API — not in the topic's history, not on the stream, not to a manager reading the ledger;
  • sinks are skipped, because a Discord channel or a webhook is a place rather than a person;
  • once every delivery is final and an hour has passed, the stored content is scrubbed and scrubbed_at is set. A delivery still pending after a day is failed with the reason and the content goes anyway.

What remains is the ledger: the title, who it reached, over which channel, and how it went. The flag is additive — a sensitive kind cannot be unmarked per publish — and it is resolved when the message is published, so editing the catalogue later does not expose what was already sent.

{"topicId": "tp_…", "kind": "password.reset",
 "recipients": [{"urn": "urn:xeonr:auth:uid:user:42"}],
 "payload": {"reset_url": "https://…/reset?token=…"}}

Publishing a kind nobody registered works. The catalogue is defaults and documentation, not a gate — otherwise no product could ship an event without a catalogue change first.

A template belongs to (app, kind) and carries a body per channel: an email subject and HTML, a push title, a Discord body, an inbox title. Templates declare their variables, so a publish that omits a required one fails on the publish call rather than rendering an empty string into somebody's inbox an hour later.

{"topicId": "tp_…", "kind": "request.approved",
 "payload": {"title": "Dune", "year": 1984}}

Rendering happens at publish, once, and the result is stored per channel. So a template edited afterwards cannot rewrite a message in flight, and the ledger shows the text that actually left.

A message with no kind, or no published template, uses its title and body verbatim. That is the curl -d hello path and it keeps working with no catalogue at all.

Reading it back

  • MessageService/GetMessage — one message with its full ledger, and, for somebody who can manage the topic, what each channel was sent and the payload it rendered from.
  • MessageService/ListInbox, MarkRead, UnreadCount — the caller's own in-app deliveries.
  • MessageService/Stream — follow a topic live, with since to replay what you missed first, in order.

Superseded and not-yet-due messages are in a topic's log — where a publisher checks what it queued and what got collapsed — but not in a stream, because a stream is what reached people.

On this page