Update my current home
Current Home
Update my current home
Partial update of the authenticated user’s current-home listing.
PATCH
Update my current home
Overview
Applies a partial update to the caller’scurrent_homes document. Every field in the request body is optional; only the supplied fields are written. The Mongoose pre-save hook recomputes rentMonthlyMinor whenever rent changes, so weekly→monthly normalisation stays accurate for the matching engine.
Photos are managed through the dedicated /me/photos* endpoints, not this one. The description field can be updated here (subject to the 100..150-char rule) once onboarding step 3 has been submitted.
PATCH does not trigger a tenancy re-review automatically. The plan calls for a re-review when material fields (address / postcode / property type) change; that wiring lands with the Phase 6 admin queue.
Authentication
Bearer <accessToken> required. Scope: user.
Path parameters
None.Query parameters
None.Request body
Every field is optional. Send only what you want to change.| Field | Type | Allowed values / Constraints | Example |
|---|---|---|---|
propertyType | enum? | DETACHED, SEMI_DETACHED, TERRACED, FLAT, MAISONETTE, BUNGALOW | FLAT |
bedrooms | integer? | 0..10 | 3 |
bathrooms | integer? | 0..10 | 2 |
address | string? | 1..500 chars | 27 Camden High Street |
addressDetails | string? | 0..200 chars. Free-text detail (house/flat no, street). Display-only. | Flat 4 |
postcode | string? | UK postcode regex; server uppercases and inserts the space | NW1 7JE |
location | object? | { lng, lat } (server stores as GeoJSON Point) | { "lng": -0.1426, "lat": 51.5390 } |
rent | object? | { amountMinor: integer > 0, frequency: "WEEKLY" | "MONTHLY" } | { "amountMinor": 130000, "frequency": "MONTHLY" } |
features | string[]? | Multi-enum: GARDEN, PARKING, BALCONY, LIFT, GROUND_FLOOR, PETS_ALLOWED, WHEELCHAIR_ACCESS | ["GARDEN", "PARKING"] |
description | string? | 100..150 chars (inclusive) | Bright 2-bed flat ... |
Example payload
Response — 200 OK
Returns the updated Home object.Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Any field fails Zod (e.g. bedrooms: 99, malformed postcode, rent amount ≤ 0). |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 404 | NOT_FOUND | The user has no current_homes document yet. |
Example error — 400
Side effects
$sets the supplied fields on the caller’scurrent_homesdocument.- The pre-save hook recomputes
rentMonthlyMinorifrentis in the patch. updatedAtis bumped tonow.- The matching engine will pick up the new values on its next
match.recomputejob (currently a stub; Phase 3 implements the worker).