Dominevo
ReferenceHTTP API

snapshot

The snapshot router: 9 methods of the snapshot capability, with tier, scope, input and output.

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

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

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
getDeviceSettingsContributionqueryprotectedviewyes
getDeviceLiveContributionqueryprotectedviewyes
applyDeviceSettingsPatchmutationadminadmin onlyno
getSnapshotqueryprotectedviewyes
invalidateCachemutationadminadmin onlyno
getSnapshotOverviewqueryprotectedviewyes
getDebugStatequeryprotectedviewyes
getSnapshotLinksqueryprotectedviewyes

snapshot.getStatus

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

Input

{ deviceId: number }

Output

{ lastCapturedAt: number | null; cacheAgeMs: number | null; lastBytes: number | null; lastStreamId: string | null }

snapshot.getDeviceSettingsContribution

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

Input

{ deviceId: number }

Output

{ tabs?: ({ id: string; label: string; icon: string; order?: number })[]; sections: ({ id: string; title: string; description?: string; style?: "card" | "accordion"; defaultCollapsed?: boolean; columns?: 1 | 2 | 3 | 4; tab?: string; location?: "settings" | "top-tab" | "hero"; order?: number; fields: any[] })[] } | null

snapshot.getDeviceLiveContribution

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

Input

{ deviceId: number }

Output

{ tabs?: ({ id: string; label: string; icon: string; order?: number })[]; sections: ({ id: string; title: string; description?: string; style?: "card" | "accordion"; defaultCollapsed?: boolean; columns?: 1 | 2 | 3 | 4; tab?: string; location?: "settings" | "top-tab" | "hero"; order?: number; fields: any[] })[] } | null

snapshot.applyDeviceSettingsPatch

  • Kind: mutation — POST /trpc/snapshot.applyDeviceSettingsPatch (added by the framework)
  • 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=snapshot.applyDeviceSettingsPatch on your hub

Input

{ deviceId: number; patch: Record<string, unknown> }

Output

{ success: true }

snapshot.getSnapshot

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

Input

{ deviceId: number; streamId?: string; force?: boolean }

Output

SnapshotImageSchema | null

Shapes: SnapshotImageSchema

snapshot.invalidateCache

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

Input

{ deviceId: number }

Output

void

snapshot.getSnapshotOverview

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

Input

{ deviceIds: number[] }

Output

({ deviceId: number; lastCapturedAt: number | null; cacheAgeMs: number | null; etag: string | null })[]

snapshot.getDebugState

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

Input

{ deviceId: number }

Output

{ battery: { sleeping: boolean; lastUpdated: number; lastContactAt?: number } | null; state: { isBattery: boolean; reason: "disabled" | "offline" | "sleeping" | "unreachable" | "waking" | null }; frame: { capturedAt: number | null; ageMs: number | null }; waking: boolean }
  • Kind: query — GET /trpc/snapshot.getSnapshotLinks
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability snapshot, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=snapshot.getSnapshotLinks on your hub

Input

{ targets: ({ deviceId: number; width?: number })[] }

Output

({ deviceId: number; url: string | null; capturedAt: number | null; ageMs: number | null; expiresAt: number | null; width: number | null; neverCaptured: boolean; sleeping: boolean; stateReason: "disabled" | "offline" | "sleeping" | "unreachable" | "waking" | null; battery: boolean })[]