PATCH
/
api
/
v1
/
current-home
/
me
Update my current home
curl --request PATCH \
  --url https://api.example.com/api/v1/current-home/me
import 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_body

Overview

Applies a partial update to the caller’s current_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.
FieldTypeAllowed values / ConstraintsExample
propertyTypeenum?DETACHED, SEMI_DETACHED, TERRACED, FLAT, MAISONETTE, BUNGALOWFLAT
bedroomsinteger?0..103
bathroomsinteger?0..102
addressstring?1..500 chars27 Camden High Street
addressDetailsstring?0..200 chars. Free-text detail (house/flat no, street). Display-only.Flat 4
postcodestring?UK postcode regex; server uppercases and inserts the spaceNW1 7JE
locationobject?{ lng, lat } (server stores as GeoJSON Point){ "lng": -0.1426, "lat": 51.5390 }
rentobject?{ amountMinor: integer > 0, frequency: "WEEKLY" | "MONTHLY" }{ "amountMinor": 130000, "frequency": "MONTHLY" }
featuresstring[]?Multi-enum: GARDEN, PARKING, BALCONY, LIFT, GROUND_FLOOR, PETS_ALLOWED, WHEELCHAIR_ACCESS["GARDEN", "PARKING"]
descriptionstring?100..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

StatusCodeMeaning
400VALIDATION_FAILEDAny field fails Zod (e.g. bedrooms: 99, malformed postcode, rent amount ≤ 0).
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDThe 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’s current_homes document.
  • The pre-save hook recomputes rentMonthlyMinor if rent is in the patch.
  • updatedAt is bumped to now.
  • The matching engine will pick up the new values on its next match.recompute job (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"] }'