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.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
listZones | query | protected | view | yes |
addZone | mutation | admin | admin only | no |
removeZone | mutation | admin | admin only | no |
updateZone | mutation | admin | admin only | no |
zones.listZones
- Kind: query —
GET /trpc/zones.listZones - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityzones, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=zones.listZoneson 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.addZoneon your hub
Input
{ deviceId: number; zone: ZoneSchema }Output
voidShapes: 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.removeZoneon your hub
Input
{ deviceId: number; zoneId: string }Output
voidzones.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.updateZoneon your hub
Input
{ deviceId: number; zone: ZoneSchema }Output
voidShapes: ZoneSchema