Onboarding step 4 — desired home
Onboarding
Onboarding step 4 — desired home
Submit matching preferences. Completes onboarding. Step 4 of 4.
POST
Onboarding step 4 — desired home
Overview
Submits the user’s matching preferences (the “desired home” filter) and completes onboarding. After a successful call:user_preferencesis persisted (full replace).users.onboardingStatus = COMPLETEandusers.currentStep = null.- A
tenancy.reviewjob is enqueued (admin queue gate — Phase 6 will consume it). - A
match.recomputejob is enqueued (Phase 3 will consume it).
409 STATE_CONFLICT. Further preferences edits go through PUT /preferences/me; further listing edits through /current-home/me/*.
Preconditions:
currentStepis exactly4.
Authentication
Bearer <accessToken> required. Scope: user.
Path parameters
None.Query parameters
None.Request body
| Field | Type | Required | Allowed values / Constraints | Example |
|---|---|---|---|---|
desiredPropertyTypes | string[] | yes | Non-empty array of: DETACHED, SEMI_DETACHED, TERRACED, FLAT, MAISONETTE, BUNGALOW | ["FLAT", "MAISONETTE"] |
minBedrooms | integer | yes | 0..10 inclusive. Must be <= maxBedrooms. | 1 |
maxBedrooms | integer | yes | 0..10 inclusive. Must be >= minBedrooms. | 3 |
maxRent | object | yes | See MaxRent object. | |
preferredLocations | object[] | yes | 1..5 entries. See PreferredLocation object. | |
searchRadiusMiles | number | yes | One of: 0, 1, 3, 5, 10, 25. (0 means “exact postcode only”.) | 5 |
desiredFeatures | string[] | no | Subset of: GARDEN, PARKING, BALCONY, LIFT, GROUND_FLOOR, PETS_ALLOWED, WHEELCHAIR_ACCESS. Defaults to []. | ["BALCONY"] |
MaxRent object
| Field | Type | Required | Notes / Constraints | Example |
|---|---|---|---|---|
amountMinor | integer | yes | Positive integer pence. | 150000 |
frequency | enum | yes | WEEKLY, MONTHLY | MONTHLY |
PreferredLocation object
| Field | Type | Required | Notes / Constraints | Example |
|---|---|---|---|---|
label | string | yes | 1..200 chars. Human-readable area name. | Camden, London |
lng | number | yes | -180..180. Decimal degrees, WGS-84. | -0.1426 |
lat | number | yes | -90..90. Decimal degrees, WGS-84. | 51.5390 |
postcode | string | null | yes | 1..16 chars, or null when the user selected an area rather than a postcode. | NW1 7JE |
Example payload
Response — 200 OK
Returns the refreshed onboarding state.onboardingStatus flips to COMPLETE and currentStep becomes null.
| Field | Type | Allowed values | Example |
|---|---|---|---|
onboardingStatus | enum | becomes COMPLETE | COMPLETE |
currentStep | integer | null | becomes null | null |
tenancyStatus | enum | unchanged from step-1 submission | PENDING |
Example response
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Body fails Zod validation, including the minBedrooms <= maxBedrooms cross-field check or an unsupported searchRadiusMiles. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 409 | STATE_CONFLICT | currentStep is not 4, or onboarding is already complete. |
Example error — 400
Side effects
- Upserts the caller’s row in the
user_preferencescollection (maxRentMonthlyMinoris derived server-side). - Sets
users.onboardingStatus = COMPLETE,users.currentStep = null, and stampsonboardingCompletedAt. - Enqueues a
tenancy.reviewjob for the admin review queue (consumed in Phase 6) when atenancyVerificationIdexists. - Enqueues a
match.recomputejob (consumed in Phase 3) withreason: 'preferences_updated'.
See also
- Get my preferences
- Replace my preferences
- Publish listing — requires
tenancyStatus = APPROVED. - Onboarding state machine