ReferenceHTTP API
zoneRules
The zoneRules router: 2 methods of the zone-rules capability, with tier, scope, input and output.
Capability zone-rules · scope device · mode singleton · source packages/types/src/capabilities/zone-rules.cap.ts:36.
Every method is called at /trpc/zoneRules.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.
zoneRules.listRules
- Kind: query —
GET /trpc/zoneRules.listRules - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityzone-rules, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=zoneRules.listRuleson your hub
Input
{ deviceId: number; stage: ZoneRuleStageEnum }Output
ZoneRuleSchema[]Shapes: ZoneRuleStageEnum · ZoneRuleSchema
zoneRules.setRules
- Kind: mutation —
POST /trpc/zoneRules.setRules - 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=zoneRules.setRuleson your hub
Input
{ deviceId: number; stage: ZoneRuleStageEnum; rules: ZoneRuleSchema[] }Output
voidShapes: ZoneRuleStageEnum · ZoneRuleSchema