Skip to main content

Users

Users are individual people who authenticate and interact with the platform. A user can belong to multiple accounts with different roles in each.

Users vs. Accounts​

UserAccount
RepresentsA personAn organization / tenant
HasEmail, password, 2FAPlan, billing, usage
ScopeCross-account identitySubscription + data

A user signs in once and then selects (or switches between) the accounts they belong to.

Roles​

Users are assigned a role (permission level) within each account. Roles are hierarchical — each level includes everything below it:

RoleAccess level
masterPlatform operator — cross-account admin (/master/* endpoints)
ownerFull account control including deletion
adminAccount administration: team, billing, account settings
developerAPI keys and webhooks, plus everything a user can do
userStandard member access

The full matrix lives in demo-server/config/default.json under permissions.

API endpoints​

MethodEndpointDescription
GET/userGet the authenticated user's profile
PATCH/userUpdate profile (name, avatar, etc.)
PUT/user/passwordChange password (body: { oldpassword, newpassword }; enforces history check)
PUT/user/2faEnable or disable 2FA (body: { twoFactor_enabled: true|false })
POST/user/2fa/verifyConfirm 2FA setup with an OTP code

Email notification preferences are account-scoped — see GET/PUT /account/email-preferences on the Accounts page.

Team management (admin)​

Admins manage the users on their account through the /users group:

MethodEndpointDescription
POST/usersAdd a user to the account
GET/users/accountList the users on the account
GET/users/permissionsList assignable permission levels
GET/users/:idGet a single user
PATCH/usersUpdate a user's details or role
DELETE/usersRemove a user from the account

Password policy​

  • Passwords are hashed with Argon2
  • The last N passwords are stored and cannot be reused:
NUMBER_OF_PREVIOUS_PASSWORDS=5

2FA setup flow​

  1. Call PUT /user/2fa with { "twoFactor_enabled": true } → server returns TOTP secret + QR code URL
  2. User scans the QR code in their authenticator app (Google Authenticator, Authy, etc.)
  3. User submits a valid OTP to POST /user/2fa/verify to confirm setup
  4. Server stores the secret and issues one-time backup codes
TOTP_LOGO_URL=https://yourdomain.com/logo.png  # Logo shown in the authenticator app

Invitations​

Users are added to accounts via an invite flow (admin role required):

MethodEndpointDescription
POST/inviteSend an invite email to a new user
GET/inviteList pending invites for the account
GET/invite/:idGet a single invite
DELETE/inviteRevoke a pending invite

The invited user completes signup through the link in the email; the invite is marked as used once accepted.