POST
Register (email + password)

Overview

Starts a new registration from the Create account screen. The client collects the user’s firstName, lastName, email, password, an optional dateOfBirth, and explicit termsAccepted + privacyAccepted consent (both must be true). Names should be entered exactly as they appear on the tenancy agreement, since they are later matched against the uploaded tenancy document. On success the account is created with emailVerified: false, the profile + consent fields are persisted (consent timestamps recorded), and a 6-digit one-time verification code is sent to the supplied email via Resend. The client must then call POST /verify-email with the code to log the user in — this endpoint does NOT return tokens. If the email is already registered with the same password, this is treated as an idempotent retry: a fresh verification code is dispatched and userId returns null. The response is intentionally identical to the new-account case so a caller cannot tell the email already existed. If the email is registered with a different password the request is rejected with 409 EMAIL_ALREADY_REGISTERED. If the email is registered via OAuth (Google / Apple) the request is rejected with 409 ACCOUNT_EXISTS_VIA_OAUTH so the client can redirect to the appropriate sign-in flow.

Authentication

None required.

Path parameters

None.

Query parameters

None.

Request body

Example payload

Response — 201 Created

Example response

Error responses

Example error — 409

Side effects

  • Inserts a new row into the users collection with emailVerified: false, the supplied firstName / lastName / dateOfBirth, and termsAccepted / privacyAccepted set to true with their acceptance timestamps (idempotent retry skips insert).
  • Inserts a row into the otp_codes collection (purpose: 'email_verify', 5-min TTL). Any prior outstanding code for this email is invalidated.
  • Sends an email via Resend with the 6-digit code.

See also

curl