users API Postgres table
Registered human users and their long-lived public key material.
Declared in packages/api-shared/src/schema/users.ts
Description
A user row is created during user registration. The access workflows load this table to verify signatures, encrypt user-recipient envelopes, and resolve the user's default personal organization/root container context. Private keys never live in this table; only public keys and fingerprints are stored.
Billing is per-organization (organization_billing), not per-user; this table carries no account/trial lifecycle state.
Indexes:
users_fingerprint_uniqueenforces one signing key fingerprint per user and gives auth challenge verification an indexedfingerprintlookup. The root identity listing's fingerprint-prefix filter is a range scan of the same index.users_created_at_id_idxbacks the root identity listing's keyset pagination (newest registrations first).users_default_organization_id_idxbounds personal-owner lookups during reserved organization group policy commits.
Columns
iduuid- primary key
- not null
- default gen_random_uuid()
Stable server-side user id.
fingerprinttext- not null
- unique
Unique signing key fingerprint used by authentication and signature verification.
signing_public_keytext- not null
Public signing key bytes, base64 encoded.
encapsulation_public_keytext- not null
Public KEM/encapsulation key bytes, base64 encoded. Writers use this when wrapping material directly to the user.
encapsulation_key_fingerprinttext- not null
Fingerprint of
encapsulationPublicKey. Recipient-envelope verification compares submitted fingerprints to this value.default_organization_iduuid- not null
Personal/default organization created during registration and used as the user's initial organization boundary.
registration_source_ip_addresstext- nullable
Best-effort source IP observed on the registration request. It is nullable when registration is created outside an HTTP request or no usable client IP metadata is available.
legal_terms_versiontext- nullable
The Privacy Policy and Terms of Service revision (their shared
YYYY-MM-DDeffective date) the user agreed to before registering. Registration refuses any revision but the current one.legal_terms_accepted_attimestamp- nullable
Server time of the registration that carried that agreement. Both are written together on every registration and are null only on identities registered before registration recorded an agreement.
suspended_attimestamp- nullable
When a platform operator suspended the account; null while it is in good standing. A suspended identity's challenge signatures are refused at
POST /auth/verify, so its devices cannot sign back in, and the suspension sweeps every live session. Set and cleared only through the/root/identities/{userId}/suspensionroutes, which refuse root targets (administrators of the operator organization; seeoperatorOrganization).last_active_attimestamp- nullable
Most recent authenticated request timestamp, written on the session middleware's throttled activity path (about once a minute per session). Nullable until the user's first authenticated request after registration.
created_attimestamp- not null
- default now()
Server-side registration timestamp.
Indexes
users_created_at_id_idx(created_at, id)users_default_organization_id_idx(default_organization_id)
Referenced by
- purged_object_reservations (owner_user_id)
- user_device_states (user_id)
- user_devices (user_id)
- user_two_factor (user_id)
- user_two_factor_recovery_codes (user_id)