ReferenceHTTP API
deviceState
The deviceState router: 9 methods of the device-state capability, with tier, scope, input and output.
Capability device-state · scope system · mode singleton · source packages/types/src/capabilities/device-state.cap.ts:84.
Every method is called at /trpc/deviceState.<method> — queries with GET, mutations with POST. See How to call and Authorization.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getSnapshot | query | protected | view | no |
getCapSlice | query | protected | view | no |
getAllSnapshots | query | protected | view | no |
setCapSlice | mutation | protected | create | no |
claimFields | mutation | admin | admin only | no |
patchOwnedFields | mutation | admin | admin only | no |
releaseClaim | mutation | admin | admin only | no |
listClaims | query | admin | admin only | no |
getNativeCapSlice | query | admin | admin only | no |
deviceState.getSnapshot
- Kind: query —
GET /trpc/deviceState.getSnapshot - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydevice-state, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=deviceState.getSnapshoton your hub
Input
{ deviceId: number }Output
Record<string, Record<string, unknown>>deviceState.getCapSlice
- Kind: query —
GET /trpc/deviceState.getCapSlice - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydevice-state, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=deviceState.getCapSliceon your hub
Input
{ deviceId: number; capName: string; confirmed?: boolean }Output
Record<string, unknown> | nulldeviceState.getAllSnapshots
- Kind: query —
GET /trpc/deviceState.getAllSnapshots - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydevice-state, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=deviceState.getAllSnapshotson your hub
Input
{ confirmed?: boolean }Output
Record<string, Record<string, Record<string, unknown>>>deviceState.setCapSlice
- Kind: mutation —
POST /trpc/deviceState.setCapSlice - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitydevice-state, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=deviceState.setCapSliceon your hub
Input
{ deviceId: number; capName: string; slice: Record<string, unknown> }Output
voiddeviceState.claimFields
- Kind: mutation —
POST /trpc/deviceState.claimFields - 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=deviceState.claimFieldson your hub
Input
{ deviceId: number; capName: string; owner: string; mode: FieldClaimModeSchema; fields: string[]; values: Record<string, unknown> }Output
ClaimOutcomeSchemaShapes: FieldClaimModeSchema · ClaimOutcomeSchema
deviceState.patchOwnedFields
- Kind: mutation —
POST /trpc/deviceState.patchOwnedFields - 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=deviceState.patchOwnedFieldson your hub
Input
{ deviceId: number; capName: string; owner: string; values: Record<string, unknown> }Output
ClaimOutcomeSchemaShapes: ClaimOutcomeSchema
deviceState.releaseClaim
- Kind: mutation —
POST /trpc/deviceState.releaseClaim - 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=deviceState.releaseClaimon your hub
Input
{ deviceId: number; capName: string; owner: string }Output
ClaimOutcomeSchemaShapes: ClaimOutcomeSchema
deviceState.listClaims
- Kind: query —
GET /trpc/deviceState.listClaims - 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=deviceState.listClaimson your hub
Input
{ ownerPrefix?: string }Output
ClaimsListingSchemaShapes: ClaimsListingSchema
deviceState.getNativeCapSlice
- Kind: query —
GET /trpc/deviceState.getNativeCapSlice - 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=deviceState.getNativeCapSliceon your hub
Input
{ deviceId: number; capName: string }Output
Record<string, unknown> | null