Dominevo
ReferenceHTTP API

notifier

The notifier router: 3 methods of the notifier capability, with tier, scope, input and output.

Capability notifier · scope device · mode singleton · source packages/types/src/capabilities/notifier.cap.ts:109.

Every method is called at /trpc/notifier.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
sendmutationadminadmin onlyno
cancelmutationadminadmin onlyno

notifier.getStatus

  • Kind: query — GET /trpc/notifier.getStatus (added by the framework)
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability notifier, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=notifier.getStatus on your hub

Input

{ deviceId: number }

Output

NotifierStatusSchema

Shapes: NotifierStatusSchema

notifier.send

  • Kind: mutation — POST /trpc/notifier.send
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=notifier.send on your hub

Input

{ deviceId: number; title?: string; body: string; image?: string; priority?: "min" | "low" | "normal" | "high"; channel?: string; recipients?: string[]; actions?: ({ id: string; title: string; uri?: string(url); destructive?: boolean })[]; data?: Record<string, unknown> }

Output

{ notificationId: string; acceptedAt: number }

notifier.cancel

  • Kind: mutation — POST /trpc/notifier.cancel
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=notifier.cancel on your hub

Input

{ deviceId: number; notificationId: string }

Output

void