SubEthaConsole →

Concepts

SubEtha has a small vocabulary. Once these click, the rest of the API follows.

Concept What it is
Account Holds the prepaid balance and owns topics, devices, endpoints, tokens, and policies.
Topic The rendezvous point. Publishers and subscribers only ever name topics.
Message An ntfy-compatible JSON envelope plus SubEtha extensions.
Device Something running an SDK with its own Ed25519 key: a phone, a browser, a Pi, a CLI, an agent.
Endpoint A non-SDK destination: an email address, a phone number, a Slack channel, a webhook URL, a push token, an LXMF address.
Subscription Topic → endpoint, with filters and an optional escalation delay.
Transport A path a message can take: ws, sse, poll, webpush, apns, fcm, webhook, email, slack, sms, voice, mcp, lxmf, and the edge transports ble, audio, qr, lan.
Trace Per-message record of the route plan, each delivery attempt, acks, and cost. Only the topic owner sees it.

Topics

A topic name is one of:

Form Example Notes
Namespaced @alice/doorbell @handle/name. Only Alice's account can create topics under @alice/. Names are [A-Za-z0-9_-]{1,64}.
Secret t_mfrggzdfmztwq2lknnwg23tpoa t_ + 26 base32 characters (128 random bits). Anyone who knows the name can read it, like an ntfy "secret URL". Stock ntfy clients accept these names unchanged.

Global names like subetha.us/mytopic are not accepted.

A topic is created by its owner's first publish to it, or explicitly with PUT /v1/topics/{topic} (which also sets its policy). Subscribing to a topic that doesn't exist yet returns 404.

Namespaced topics are private by default: only the owner's credentials can read and publish. A policy can open them up (public_read, public_publish, allowed_publishers, allowed_readers).

Messages

A message is a superset of ntfy's message JSON:

{
  "id": "01JD5Z8W3V6X0M3K9Q2T4R7B1C",
  "time": 1763750000,
  "expires": 1763793200,
  "event": "message",
  "topic": "@alice/doorbell",
  "title": "Front door",
  "message": "Opened",
  "priority": 4,
  "tags": ["door", "warning"],
  "click": "https://cam.example.com/front",
  "attachment": { "name": "snap.jpg", "url": "https://subetha.us/file/01jd…/snap.jpg", "size": 81234, "type": "image/jpeg" },
  "route": { "mode": "any", "max_cost_usd_micros": 20000, "deny": ["voice"] }
}

The normative definition is the protocol spec and its JSON Schema.

Devices and endpoints

There are two ways to receive:

Routing

On every publish the relay builds a delivery plan. For each subscriber it intersects what's allowed by the account, the topic policy, the subscription, the token, and the message (allow and deny lists, priority thresholds, quiet hours, cost caps), then orders what's left by the route mode:

Mode Behavior
any (default) Deliver once, by the cheapest viable path. Escalation steps run only if the message is still unacked.
fast Lowest latency first.
all Every allowed transport at once (alarms).
cheap Free/live transports only; never escalate to paid ones.

Escalation is configured per subscription with after_s: for example push immediately, SMS after 60 s, a phone call after 180 s. Each step is queued with its own reservation and is skipped (and its reservation released) once anyone acks the message: an SDK, a WebSocket ack frame, a Web Push service worker, replying ACK <id> by SMS, pressing 1 on the call, or POST /v1/ack. See the escalation example.

The relay never tells a device which other devices exist or how they were reached. Only the owner sees that, in the trace.

Who pays?

So curl -d hi subetha.us/@alice/doorbell can be free for the person ringing the bell, while Alice decides exactly how much ringing she's willing to pay for. Details: Pricing & billing.

Edit this page · Markdown