Dominevo
ReferenceHTTP API

records

The records router: 17 methods of the records capability, with tier, scope, input and output.

Capability records · scope system · mode singleton · source packages/types/src/capabilities/records.cap.ts:157.

Every method is called at /trpc/records.<method> — queries with GET, mutations with POST. See How to call and Authorization.

MethodKindTierToken scopeViewer
declareKindsmutationadminadmin onlyno
getqueryadminadmin onlyno
getManyqueryadminadmin onlyno
secretRefsqueryadminadmin onlyno
putmutationadminadmin onlyno
putManymutationadminadmin onlyno
patchmutationadminadmin onlyno
deletemutationadminadmin onlyno
deleteManymutationadminadmin onlyno
queryqueryadminadmin onlyno
countqueryadminadmin onlyno
histogramqueryadminadmin onlyno
aggregatequeryadminadmin onlyno
deleteWheremutationadminadmin onlyno
transactmutationadminadmin onlyno
deleteDevicemutationadminadmin onlyno
allocateIdmutationadminadmin onlyno

records.declareKinds

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

Input

{ kinds: Record<string, { database?: "settings" | "events" = "settings"; class: "config" | "ledger" | "audit" | "mirror" | "ephemeral"; writeTrigger: string; device?: "required" | "optional" | "none" = "none"; at?: "required" | "none" = "none"; indexes?: ({ name: string; fields: string[]; unique?: boolean })[] = []; retention: { ttlMs: number; from: "at" | "write" } | { maxRows?: number; maxRowsPerDevice?: number } | { owner: string; reason: string } | { none: string }; deviceRemoval?: "delete" | "none" = "none"; maxDataBytes?: number = 65536; secretPaths?: string[] = []; secretArrayKeys?: Record<string, string> = {}; transactFamily?: string; entry?: { title: string; nameField: string; fields: Record<string, unknown> } }> }

Output

{ kinds: Record<string, DeclareKindResultSchema> }

Shapes: DeclareKindResultSchema

records.get

  • Kind: query — GET /trpc/records.get
  • 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=records.get on your hub

Input

{ kind: string; id: string }

Output

RecordViewSchema | null

Shapes: RecordViewSchema

records.getMany

  • Kind: query — GET /trpc/records.getMany
  • 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=records.getMany on your hub

Input

{ kind: string; ids: string[] }

Output

RecordViewSchema[]

Shapes: RecordViewSchema

records.secretRefs

  • Kind: query — GET /trpc/records.secretRefs
  • 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=records.secretRefs on your hub

Input

{ kind: string; ids: string[] }

Output

RecordSecretRefsSchema

Shapes: RecordSecretRefsSchema

records.put

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

Input

{ kind: string; record: RecordInputSchema; ifRev?: number }

Output

{ rev: number; releasedRefs: string[] }

Shapes: RecordInputSchema

records.putMany

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

Input

{ kind: string; records: RecordInputSchema[] }

Output

{ count: number; releasedRefs: string[] }

Shapes: RecordInputSchema

records.patch

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

Input

{ kind: string; id: string; data: RecordBodySchema; at?: number | null; expiresAt?: number | null; ifRev?: number }

Output

{ rev: number; releasedRefs: string[] }

Shapes: RecordBodySchema

records.delete

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

Input

{ kind: string; id: string }

Output

{ deleted: boolean; secretRefs: string[] }

records.deleteMany

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

Input

{ kind: string; ids: string[] }

Output

{ deleted: number; secretRefs: string[] }

records.query

  • Kind: query — GET /trpc/records.query
  • 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=records.query on your hub

Input

RecordQueryInputSchema

Output

RecordQueryResultSchema

Shapes: RecordQueryInputSchema · RecordQueryResultSchema

records.count

  • Kind: query — GET /trpc/records.count
  • 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=records.count on your hub

Input

{ kind: string; deviceId?: number; atFrom?: number; atTo?: number; where?: RecordWhereSchema }

Output

{ count: number }

Shapes: RecordWhereSchema

records.histogram

  • Kind: query — GET /trpc/records.histogram
  • 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=records.histogram on your hub

Input

{ kind: string; deviceId?: number; from: number; to: number; bucketMs: number }

Output

{ buckets: ({ bucketStart: number; count: number })[] }

records.aggregate

  • Kind: query — GET /trpc/records.aggregate
  • 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=records.aggregate on your hub

Input

{ kind: string; op: "sum" | "min" | "max" | "count"; field?: string; groupBy?: string; where?: RecordWhereSchema }

Output

{ rows: ({ group: string | number | null; value: number | null })[] }

Shapes: RecordWhereSchema

records.deleteWhere

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

Input

{ kind: string; deviceId?: number; atBefore?: number; where?: RecordWhereSchema }

Output

{ deleted: number; secretRefs: string[] }

Shapes: RecordWhereSchema

records.transact

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

Input

{ ops: RecordTransactOpSchema[] }

Output

{ results: ({ rev: number | null; deleted: boolean })[]; releasedRefs: string[]; secretRefs: string[] }

Shapes: RecordTransactOpSchema

records.deleteDevice

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

Input

{ deviceId: number; kinds?: string[] }

Output

{ deleted: Record<string, number>; secretRefs: string[] }

records.allocateId

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

Input

{ kind: string }

Output

{ id: number }