Skip to Content
Xeonr Developer Docs
API SpecificationMessages

Publish

POST
/xeonr.notify.v1.MessageService/Publish

Publishes one event to a topic. Needs publish on the topic. An idempotency_key seen before on the same topic returns the earlier message with created=false, so a retry is safe.

With no recipients the message reaches whoever subscribed. With recipients it is directed: those people, and the members of any team named (optionally narrowed by role), receive it whether or not they subscribed — the "your request was approved" case. A subscription, where one exists, still governs how it reaches them, so somebody who muted the topic still hears nothing.

When the (app, kind) has a published template, payload is rendered through it and a missing required variable fails here rather than rendering an empty string into somebody's inbox an hour later. With no template, title and body are used verbatim — the ntfy path, which works with no catalogue at all.

Required scopes: notify:messages:edit

Authorization

BearerAuth
AuthorizationBearer <token>

An access token from Xeonr Auth, presented as Authorization: Bearer <token>. Its audience must include https://notify.xeonr.io, and it must carry the scope the method lists.

In: header

Header Parameters

Connect-Protocol-Version*number

Define the version of the Connect protocol

Value in1
Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

topicId?string
Length1 <= length <= 32
title?string

Trimmed to 255 characters, the column width, by the server.

Lengthlength <= 255
body?string
Lengthlength <= 16384
priority?integer

1 min … 5 max; 0 means the default (3).

Formatint32
Range0 <= value <= 5
tags?array<>
Itemsitems <= 32
clickUrl?string
Lengthlength <= 1024
appSlug?string

The publishing product.

Left empty it is resolved, widest answer last: the caller's own application when a service account is publishing, else the topic's. So a product's service account never has to name itself, and a product publishing to a topic somebody else minted is still attributed to the product rather than to the topic's owner.

A person's token is not used this way even though it also names an application — attributing somebody's console publish to the console itself would mislabel it.

It decides more than a label: the kind catalogue that supplies defaults, the template that gets selected, the branding the email is dressed in, and the scope a recipient's preferences are matched against.

Lengthlength <= 64
kind?string

A product's event kind ("request.approved"). When the app has a published template for it, the kind is what selects that template — and the catalogue entry supplies the default priority and channels.

Lengthlength <= 64
idempotencyKey?string
Lengthlength <= 191
recipients?array<>

Direct the message at people or teams rather than at subscribers.

Itemsitems <= 50
payload?

The template variables, when publishing through a template. Matched against the template version's declared variables: a missing required one fails here, rather than rendering an empty string into somebody's inbox an hour later.

Ignored when the (app, kind) has no published template, in which case title and body are used verbatim — that is the ntfy path and it must keep working with no catalogue at all. validate:skip free-form template variables; the template version's declared variables are what bound them

coalesceKey?string

Collapse near-identical messages: this publish supersedes any earlier message on the same topic with the same key whose delivery has not gone out yet. The product computes the key, because only it knows what counts as near-identical.

Distinct from idempotency_key, which stops the same publish happening twice. A coalesce key is for genuinely different publishes about the same thing, where only the latest is worth a buzz.

Lengthlength <= 191
deliverAt?string

Hold the message until this time. In the past, or absent, is immediately. Refused beyond 30 days out.

Formatdate-time
actions?array<>

Buttons on the notification, where the channel has them.

Itemsitems <= 3
markdown?boolean

The body is markdown; channels that can render it will. validate:skip a bool has no bounds

sensitive?boolean

Mark this one message sensitive regardless of its kind: the content is never readable over the API and is scrubbed once delivered (see Message.sensitive). Additive only — a kind registered as sensitive cannot be unmarked per publish. validate:skip a bool has no bounds

sender?string

A sender profile of the publishing product: a mail-relay credential the product registered under urn:xeonr:auth:application:<id>/<sender>, whose from address, relay and optional branding this message's email goes out with instead of the product's default. For a product that sends on behalf of several tenants with their own mail identities. Unknown profiles fall back to the product's own credential, then the topic owner's, then the deployment's.

Match^([a-z0-9][a-z0-9-]*)?$
Lengthlength <= 64
fields?array<>

Labelled facts about the event: "Status", "Assignee", "Project". Rendered as embed fields on Discord and a definition list in email and the inbox. Not templated — a field is data, and a template that wants the same fact in its wording takes it from the payload.

Itemsitems <= 10
colour?string

An accent colour, #rrggbb, for channels that tint (the Discord embed). Empty leaves the priority colour. Validated here because it reaches an email's style attribute, where escaping is least reassuring.

Match^(#[0-9a-fA-F]{6})?$
Lengthlength <= 7
attachments?array<>

Files that go with the message, fetched by notify at send time from these signed https URLs and uploaded where the channel can carry them. Make the links last as long as a delivery may retry.

Itemsitems <= 10
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://notify.xeonr.io/xeonr.notify.v1.MessageService/Publish" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "map[actions:[map[label:Open request url:https://notify.xeonr.io/messages/msg_8b1e4d7a9c2f6e0b3a5d1c47]] appSlug:xmb body:Luke approved your request for Dune: Part Two. clickUrl:https://notify.xeonr.io/messages/msg_8b1e4d7a9c2f6e0b3a5d1c47 createdAt:2026-10-22T09:30:00Z failedCount:0 fanoutAt:2026-10-22T09:30:02Z id:msg_8b1e4d7a9c2f6e0b3a5d1c47 kind:request.approved priority:3 publisher:urn:xeonr:auth:uid:service_account:57 recipientCount:2 sentCount:2 tags:[requests movies] templateVersion:2 title:Dune: Part Two was approved topicId:tp_3f9a1c7e2b8d4a6f0c5e9b12 topicName:xmb/requests/u-3]",
  "created": "true",
  "superseded": "1",
  "unaddressable": [
    "urn:xeonr:auth:uid:user:88"
  ]
}