Dominevo
ReferenceHTTP API

userManagement

The userManagement router: 23 methods of the user-management capability, with tier, scope, input and output.

Capability user-management · scope system · mode singleton · source packages/types/src/capabilities/user-management.cap.ts:116.

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

MethodKindTierToken scopeViewer
listUsersqueryadminadmin onlyno
getAdminBootstrapStatusqueryadminadmin onlyno
createUsermutationadminadmin onlyno
updateUsermutationadminadmin onlyno
deleteUsermutationadminadmin onlyno
resetPasswordmutationadminadmin onlyno
setUserScopesmutationadminadmin onlyno
validateCredentialsmutationprotectedviewno
setupTotpmutationadminadmin onlyno
confirmTotpmutationadminadmin onlyno
disableTotpmutationadminadmin onlyno
getTotpStatusqueryadminadmin onlyno
migrateRawSecretsmutationadminadmin onlyno
verifyTotpmutationprotectedviewno
oauthIssueCodemutationprotectedcreateno
oauthExchangeCodemutationprotectedviewno
oauthRefreshmutationprotectedviewno
oauthVerifyAccessTokenqueryprotectedviewno
listExternalIdentitiesqueryadminadmin onlyno
findUserByExternalIdentityqueryadminadmin onlyno
unlinkExternalIdentitymutationadminadmin onlyno
listOauthSessionsqueryadminadmin onlyno
revokeOauthSessionmutationadminadmin onlyno

userManagement.listUsers

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

Input

void

Output

UserSummarySchema[]

Shapes: UserSummarySchema

userManagement.getAdminBootstrapStatus

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

Input

void

Output

{ defaultPasswordInUse: boolean }

userManagement.createUser

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

Input

CreateUserInputSchema

Output

UserSummarySchema

Shapes: CreateUserInputSchema · UserSummarySchema

userManagement.updateUser

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

Input

UpdateUserInputSchema

Output

{ success: true }

Shapes: UpdateUserInputSchema

userManagement.deleteUser

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

Input

{ id: string }

Output

{ success: true }

userManagement.resetPassword

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

Input

{ id: string; newPassword: string }

Output

{ success: true }

userManagement.setUserScopes

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

Input

{ userId: string; scopes: ({ type: "viewer"; allow: "*" | number[]; block: number[]; features: ("face-assignment" | "plate-assignment" | "retrain" | "scenes")[] } | pipe)[] }

Output

{ success: true }

userManagement.validateCredentials

  • Kind: mutation — POST /trpc/userManagement.validateCredentials
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.validateCredentials on your hub

Input

{ username: string; password: string }

Output

{ id: string; username: string; isAdmin?: boolean = false; allowedProviders: string[] | "*"; allowedDevices: Record<string, string[] | "*">; scopes?: ({ type: "viewer"; allow: "*" | number[]; block: number[]; features: ("face-assignment" | "plate-assignment" | "retrain" | "scenes")[] } | pipe)[] = []; totpEnabled?: boolean = false; createdAt: number; updatedAt: number; passwordHash: string } | null

userManagement.setupTotp

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

Input

{ userId: string }

Output

{ secret: string; otpauthUrl: string }

userManagement.confirmTotp

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

Input

{ userId: string; code: string }

Output

{ success: true }

userManagement.disableTotp

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

Input

{ userId: string }

Output

{ success: true }

userManagement.getTotpStatus

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

Input

{ userId: string }

Output

{ enabled: boolean; confirmedAt: number | null }

userManagement.migrateRawSecrets

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

Input

RawSecretMigrationInputSchema

Output

RawSecretMigrationReportSchema

Shapes: RawSecretMigrationInputSchema · RawSecretMigrationReportSchema

userManagement.verifyTotp

  • Kind: mutation — POST /trpc/userManagement.verifyTotp
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.verifyTotp on your hub

Input

{ userId: string; code: string }

Output

{ valid: boolean }

userManagement.oauthIssueCode

  • Kind: mutation — POST /trpc/userManagement.oauthIssueCode
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.oauthIssueCode on your hub

Input

{ integrationId: string; instanceId?: string; userId: string; username: string; scopes: pipe[]; redirectUri: string; hubUrl: string; codeChallenge?: string; refreshTtlSec?: number | "never" }

Output

{ code: string }

userManagement.oauthExchangeCode

  • Kind: mutation — POST /trpc/userManagement.oauthExchangeCode
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.oauthExchangeCode on your hub

Input

{ code: string; redirectUri: string; codeVerifier?: string }

Output

{ accessToken: string; refreshToken: string; expiresIn: number } | null

userManagement.oauthRefresh

  • Kind: mutation — POST /trpc/userManagement.oauthRefresh
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.oauthRefresh on your hub

Input

{ refreshToken: string }

Output

{ accessToken: string; refreshToken: string; expiresIn: number } | null

userManagement.oauthVerifyAccessToken

  • Kind: query — GET /trpc/userManagement.oauthVerifyAccessToken
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability user-management, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=userManagement.oauthVerifyAccessToken on your hub

Input

{ token: string }

Output

{ userId: string; username: string; scopes: pipe[]; instanceId?: string } | null

userManagement.listExternalIdentities

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

Input

{ userId: string }

Output

ExternalIdentitySchema[]

Shapes: ExternalIdentitySchema

userManagement.findUserByExternalIdentity

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

Input

ExternalIdentityKeySchema

Output

{ userId: string; issuer: string } | null

Shapes: ExternalIdentityKeySchema

userManagement.unlinkExternalIdentity

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

Input

{ provider: string; subject: string; userId: string }

Output

{ success: boolean }

userManagement.listOauthSessions

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

Input

void

Output

({ id: string; userId: string; username: string; integrationId: string; instanceId?: string | null; scopes: pipe[]; createdAt: number; lastUsedAt: number; revokedAt: number | null })[]

userManagement.revokeOauthSession

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

Input

{ id: string }

Output

{ success: boolean }