Update my current home
curl --request PATCH \
--url https://api.example.com/api/v1/current-home/meimport requests
url = "https://api.example.com/api/v1/current-home/me"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/current-home/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/current-home/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/current-home/me"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/api/v1/current-home/me")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/current-home/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyCurrent Home
Update my current home
Partial update of the authenticated user’s current-home listing.
PATCH
/
api
/
v1
/
current-home
/
me
Update my current home
curl --request PATCH \
--url https://api.example.com/api/v1/current-home/meimport requests
url = "https://api.example.com/api/v1/current-home/me"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/current-home/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/current-home/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/current-home/me"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/api/v1/current-home/me")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/current-home/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyOverview
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 50..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, STUDIO | 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, NEW_BUILD | ["GARDEN", "PARKING"] |
description | string? | 50..150 chars (inclusive) | Bright 2-bed flat ... |
Example payload
{
"bedrooms": 3,
"rent": {
"amountMinor": 130000, // integer pence
"frequency": "MONTHLY" // enum: "WEEKLY" | "MONTHLY"
},
"features": ["GARDEN", "PARKING", "LIFT"]
}
Response — 200 OK
Returns the updated Home object.{
"home": {
"id": "66400a8f1c2b4d5e6f7a8c00"
// ...rest of the home shape (see GET /current-home/me)
}
}
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
{
"type": "https://api.swappr.co.uk/errors/validation-failed",
"title": "Validation failed",
"status": 400,
"code": "VALIDATION_FAILED",
"detail": "Request body failed validation",
"instance": "/api/v1/current-home/me",
"requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2",
"errors": [
{ "path": "bedrooms", "message": "Number must be less than or equal to 10", "code": "too_big" }
]
}
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).
See also
curl
curl -X PATCH https://api.swappr.co.uk/api/v1/current-home/me \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "bedrooms": 3, "features": ["GARDEN", "PARKING"] }'