Dominevo
ReferenceHTTP API

zones

The zones router: 4 methods of the zones capability, with tier, scope, input and output.

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

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

MethodKindTierToken scopeViewer
listZonesqueryprotectedviewyes
addZonemutationadminadmin onlyno
removeZonemutationadminadmin onlyno
updateZonemutationadminadmin onlyno

zones.listZones

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

Input

{ deviceId: number }

Output

ZoneSchema[]

Shapes: ZoneSchema

zones.addZone

  • Kind: mutation — POST /trpc/zones.addZone
  • 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=zones.addZone on your hub

Input

{ deviceId: number; zone: ZoneSchema }

Output

void

Shapes: ZoneSchema

zones.removeZone

  • Kind: mutation — POST /trpc/zones.removeZone
  • 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=zones.removeZone on your hub

Input

{ deviceId: number; zoneId: string }

Output

void

zones.updateZone

  • Kind: mutation — POST /trpc/zones.updateZone
  • 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=zones.updateZone on your hub

Input

{ deviceId: number; zone: ZoneSchema }

Output

void

Shapes: ZoneSchema