Skip to Content
Xeonr Developer Docs
API Specification

Templates

A product's event kinds and the versioned templates that word them.

postDelete kind

Removes a catalogue entry. Messages already published keep their kind string: the catalogue describes the vocabulary, it does not own history. Publishing the kind keeps working too — a product must be able to ship an event without a configuration change first. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application — the one whose slug the account's token names — so a product owns its catalogue and its credentials without a person in the loop. **Required scopes:** `notify:templates:edit`

postDelete template

Removes the template and every version of it. Messages that rendered through it keep the text they were sent with — the render is stored on the message, not looked up. Needs admin of the team that owns the app, or `notify:platform:admin`. **Required scopes:** `notify:templates:edit`

postGet template

One template for an (app, kind) with its published and draft versions in full: the default body, the per-channel overrides and the declared variables. Either may be absent — nothing published yet, or no unpublished draft. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. **Required scopes:** `notify:templates:read`

postList kinds

An app's event catalogue: the dotted event names it publishes, each with its category, default channels and priority, whether it is critical, whether it is sensitive, and whether a template has been published for it. Open to any signed-in caller — a subscriber needs the category list to filter on, and those are not secrets. Cursor-paginated: newest first, over an opaque cursor over `(created_at, kind)` — a catalogue entry has no id of its own on the wire, and `kind` is unique within the app, so it is what makes the keyset total. `limit` is clamped to 500 (0 means the default of 50); pass `next_cursor` back as `cursor` for the next page. **Required scopes:** `notify:templates:read`

postList templates

Every template for an app, each with which version is published and whether an unpublished draft exists. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. Cursor-paginated: newest first, over an opaque cursor over `(created_at, id)`. `limit` is clamped to 500 (0 means the default of 50); pass `next_cursor` back as `cursor` for the next page. **Required scopes:** `notify:templates:read`

postPreview template

Renders a template against a payload without publishing or sending anything — the console's live preview, and the way to see the email exactly as it will arrive. Pass the bodies inline to preview the editor's current contents, or omit them to render whatever is stored, draft first. An empty payload falls back to each variable's declared example, which is what makes a preview work before anybody has invented one. A kind with no template at all previews as empty rather than failing. Parse errors and missing required variables come back in `error`; variables the bodies reference but do not declare come back in `undeclared`, which is not an error but is usually a typo. Needs admin of the team that owns the app, or `notify:platform:admin`. **Required scopes:** `notify:templates:read`

postPublish template

Promotes the draft to live as a new immutable version. From here on, a publish naming this kind renders through it, and each message records the version it rendered so the delivery log can show what was sent even after the template moves on. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. **Required scopes:** `notify:templates:edit`

postPut kind

Creates or replaces one catalogue entry, idempotent on (app, kind). The category is the coarse grouping subscribers filter on — deliberately coarse, because a settings row per event type is the named failure mode of every notification system that has one. A critical kind reaches a recipient even through an off switch, and its deliveries are marked forced so the ledger shows the override rather than hiding it. A sensitive kind's content is never readable over the API and is scrubbed from the store once delivered — for password resets and one-time codes. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application — the one whose slug the account's token names — so a product owns its catalogue and its credentials without a person in the loop. **Required scopes:** `notify:templates:edit`

postSave draft

Writes the draft for an (app, kind), creating the template on the first call. Refused if the template does not parse — a draft that cannot render is not worth keeping. Declaring variables is what moves a missing field from a silent empty string in somebody's inbox to an error on the publish call. Needs admin of the team that owns the app, or `notify:platform:admin`. A product's **service account** may call this for its own application, so a product ships its wording with its code and publishes it at boot, idempotently. **Required scopes:** `notify:templates:edit`

postUnpublish template

Stops rendering through the template without deleting anything: the kind falls back to the publisher's own title and body, which is the ntfy path. The versions stay, so republishing is one call. Needs admin of the team that owns the app, or `notify:platform:admin`. **Required scopes:** `notify:templates:edit`