authentication
Authentication data models.
AccessToken
pydantic-model
¶
Bases: BaseModel
Access token details.
Fields:
-
access_token(str) -
access_token_expires_utc_seconds(int) -
user_id(UUID7)
ChangePasswordRequest
pydantic-model
¶
Bases: BaseModel
Request for an authenticated user to change their own password.
Fields:
PasswordResetEmailRequest
pydantic-model
¶
ResetPasswordRequest
pydantic-model
¶
TokenPair
pydantic-model
¶
Bases: AccessToken
Full token pair returned by login: access token plus refresh token.
(user_id and the access-token fields are inherited from AccessToken.)
Fields:
-
access_token(str) -
access_token_expires_utc_seconds(int) -
user_id(UUID7) -
refresh_token(str) -
refresh_token_expires_utc_seconds(int) -
consent_required(bool) -
pending_consents(list[PendingConsent])
UserAuthentication
pydantic-model
¶
UserInformation
pydantic-model
¶
Bases: BaseModel
Profile/vetting fields for a user.
All optional at this level so response models (UserOut/AdminUserOut)
can be built from existing accounts that predate these fields.
UserRegistration overrides the request-access fields as required.
Fields:
-
name(None | str) -
organization(None | str) -
position(None | str) -
usage_type(UsageType | None) -
purpose(None | str)
name = None
pydantic-field
¶
The user's name, as they wish to be addressed.
organization = None
pydantic-field
¶
The organization, lab, or company the user is affiliated with (or 'Independent').
position = None
pydantic-field
¶
The user's position/role in their organization.
purpose = None
pydantic-field
¶
What the user plans to use the platform for — the basis for request-access review.
usage_type = None
pydantic-field
¶
The user's primary intended use of the platform.
UserOut
pydantic-model
¶
Bases: UserInformation
User output/response model.
Extends :class:UserInformation so users can see their own profile
(name/organization/position/usage_type/purpose — e.g. the account page
shows which licence their usage type requires). All profile fields stay
optional (accounts may predate them).
Config:
from_attributes:True
Fields:
-
name(None | str) -
organization(None | str) -
position(None | str) -
usage_type(UsageType | None) -
purpose(None | str) -
id(UUID7) -
permissions(list[Permission]) -
role(Role) -
email(EmailStr) -
email_confirmed_at(datetime | None) -
approved_at(datetime | None) -
consent_required(bool) -
pending_consents(list[PendingConsent]) -
has_billing_account(bool) -
organization_id(UUID | None) -
organization_name(str | None) -
organization_role(MembershipRole | None)
approved_at = None
pydantic-field
¶
Timestamp when an admin approved the account (request-access flow). Null means the registration is still pending approval and login is blocked; distinct from disabled, which bans an already-approved account.
consent_required = False
pydantic-field
¶
True if the user must accept one or more legal documents before protected endpoints will authorize.
email
pydantic-field
¶
Email address of the user.
email_confirmed_at = None
pydantic-field
¶
Timestamp when the user's email was confirmed.
has_billing_account = False
pydantic-field
¶
Whether the user has a billing account with the payment provider, made when they first bought credits. Their purchase history and receipts can be opened only then; buying for an organization does not give its other members one.
id
pydantic-field
¶
Unique identifier of the user
organization_id = None
pydantic-field
¶
The organization the account belongs to (every account belongs to exactly one). Distinct from organization, the free-text affiliation on the profile.
organization_name = None
pydantic-field
¶
The display name of the organization the account belongs to.
organization_role = None
pydantic-field
¶
The account's role in that organization: owner, admin or member.
pending_consents
pydantic-field
¶
Documents (and versions) the user must still accept.
permissions = []
pydantic-field
¶
List of permissions assigned to the user.
role = Role.USER
pydantic-field
¶
The user's authorization role (user or admin). Distinct from billing; governs what the user may do.
UserProfileUpdate
pydantic-model
¶
Bases: BaseModel
Self-service profile update (account page).
Omitted (None) fields are left unchanged. name cannot be blanked —
accounts that have a name keep one; position may be cleared by sending
an empty string. Email/password changes go through their dedicated,
verified flows, and usage_type changes are admin-mediated (they switch
the licence the user must consent to).
Fields:
-
name(Annotated[str, Field(max_length=100), StripAndRequire] | None) -
position(str | None)
UserRegistration
pydantic-model
¶
Bases: UserAuthentication, UserInformation
Model for self-registration (request access).
Overrides the vetting fields inherited from UserInformation as required:
a request-access application must identify who is asking and why. position
stays optional. Whether usage_type values are currently selectable (e.g.
CLINICAL is not) is enforced by the api-server, not this schema.
Fields:
-
position(None | str) -
email(EmailStr) -
password(NewPasswordStr) -
name(str) -
organization(str) -
usage_type(UsageType) -
purpose(str) -
accepts(list[ConsentAcceptItem])
accepts
pydantic-field
¶
Legal documents accepted at registration (document + version). The server records these and validates the versions.
name
pydantic-field
¶
The user's name, as they wish to be addressed. A single name is fine — no first/last split is required.
organization
pydantic-field
¶
The organization, lab, or company the user is affiliated with. Use 'Independent' if none. The part before the first comma also names the organization created for the account, cut to 64 characters at a word boundary when longer; the full text stays on the profile.
password
pydantic-field
¶
The password of the user. Must be at least 8 characters long and at most 72 bytes (bcrypt's limit). Other requirements are enforced by the backend.
purpose
pydantic-field
¶
What the user plans to use the platform for — the basis for request-access review.
usage_type
pydantic-field
¶
The user's primary intended use of the platform.