Skip to content

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:

current_password pydantic-field

The user's current password, for verification.

new_password pydantic-field

The new password (at most 72 bytes — bcrypt's limit). Complexity is enforced by the backend.

PasswordResetEmailRequest pydantic-model

Bases: BaseModel

Request a password-reset link for an address.

The answer is the same whether or not an account with the address exists, so the request cannot be used to probe for accounts.

Fields:

email pydantic-field

The address of the account whose password is reset.

ResetPasswordRequest pydantic-model

Bases: BaseModel

Set a new password with the token from a reset or setup link.

Fields:

password pydantic-field

The new password. The server's password policy decides whether it is accepted.

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:

consent_required = False pydantic-field

True if the user must accept one or more legal documents before protected endpoints will authorize.

pending_consents pydantic-field

Documents (and versions) the user must still accept. Empty unless consent_required.

UserAuthentication pydantic-model

Bases: BaseModel

Model for the login auth.

Fields:

email pydantic-field

The email of the user.

password pydantic-field

The password of the user.

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 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:

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 = None pydantic-field

The user's name, as they wish to be addressed. A single name is fine — no first/last split is required.

position = None pydantic-field

The user's position/role in their organization. An empty string clears the field.

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:

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.

VerificationEmailRequest pydantic-model

Bases: BaseModel

Request a new email-confirmation link for an address.

The answer is the same whether or not an account with the address exists, so the request cannot be used to probe for accounts.

Fields:

email pydantic-field

The address of the account to confirm.