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.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
listUsers | query | admin | admin only | no |
getAdminBootstrapStatus | query | admin | admin only | no |
createUser | mutation | admin | admin only | no |
updateUser | mutation | admin | admin only | no |
deleteUser | mutation | admin | admin only | no |
resetPassword | mutation | admin | admin only | no |
setUserScopes | mutation | admin | admin only | no |
validateCredentials | mutation | protected | view | no |
setupTotp | mutation | admin | admin only | no |
confirmTotp | mutation | admin | admin only | no |
disableTotp | mutation | admin | admin only | no |
getTotpStatus | query | admin | admin only | no |
migrateRawSecrets | mutation | admin | admin only | no |
verifyTotp | mutation | protected | view | no |
oauthIssueCode | mutation | protected | create | no |
oauthExchangeCode | mutation | protected | view | no |
oauthRefresh | mutation | protected | view | no |
oauthVerifyAccessToken | query | protected | view | no |
listExternalIdentities | query | admin | admin only | no |
findUserByExternalIdentity | query | admin | admin only | no |
unlinkExternalIdentity | mutation | admin | admin only | no |
listOauthSessions | query | admin | admin only | no |
revokeOauthSession | mutation | admin | admin only | no |
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.listUserson your hub
Input
voidOutput
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.getAdminBootstrapStatuson your hub
Input
voidOutput
{ 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.createUseron your hub
Input
CreateUserInputSchemaOutput
UserSummarySchemaShapes: 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.updateUseron your hub
Input
UpdateUserInputSchemaOutput
{ 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.deleteUseron 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.resetPasswordon 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.setUserScopeson 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:
viewon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.validateCredentialson 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 } | nulluserManagement.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.setupTotpon 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.confirmTotpon 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.disableTotpon 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.getTotpStatuson 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.migrateRawSecretson your hub
Input
RawSecretMigrationInputSchemaOutput
RawSecretMigrationReportSchemaShapes: RawSecretMigrationInputSchema · RawSecretMigrationReportSchema
userManagement.verifyTotp
- Kind: mutation —
POST /trpc/userManagement.verifyTotp - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.verifyTotpon 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:
createon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.oauthIssueCodeon 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:
viewon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.oauthExchangeCodeon your hub
Input
{ code: string; redirectUri: string; codeVerifier?: string }Output
{ accessToken: string; refreshToken: string; expiresIn: number } | nulluserManagement.oauthRefresh
- Kind: mutation —
POST /trpc/userManagement.oauthRefresh - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.oauthRefreshon your hub
Input
{ refreshToken: string }Output
{ accessToken: string; refreshToken: string; expiresIn: number } | nulluserManagement.oauthVerifyAccessToken
- Kind: query —
GET /trpc/userManagement.oauthVerifyAccessToken - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityuser-management, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=userManagement.oauthVerifyAccessTokenon your hub
Input
{ token: string }Output
{ userId: string; username: string; scopes: pipe[]; instanceId?: string } | nulluserManagement.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.listExternalIdentitieson 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.findUserByExternalIdentityon your hub
Input
ExternalIdentityKeySchemaOutput
{ userId: string; issuer: string } | nullShapes: 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.unlinkExternalIdentityon 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.listOauthSessionson your hub
Input
voidOutput
({ 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.revokeOauthSessionon your hub
Input
{ id: string }Output
{ success: boolean }