Skip to main content
PATCH
/
update-property
/
{propertyId}
Update a property
curl --request PATCH \
  --url https://v2.api.uk.housr.com/update-property/{propertyId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "address": "<string>",
  "city": "<string>",
  "images": [
    "<string>"
  ],
  "price_pw": 123,
  "bedrooms": 1,
  "bathrooms": 1,
  "postcode": "<string>",
  "lat": 123,
  "lng": 123,
  "deposit": 0
}
'
import requests

url = "https://v2.api.uk.housr.com/update-property/{propertyId}"

payload = {
"title": "<string>",
"description": "<string>",
"address": "<string>",
"city": "<string>",
"images": ["<string>"],
"price_pw": 123,
"bedrooms": 1,
"bathrooms": 1,
"postcode": "<string>",
"lat": 123,
"lng": 123,
"deposit": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
address: '<string>',
city: '<string>',
images: ['<string>'],
price_pw: 123,
bedrooms: 1,
bathrooms: 1,
postcode: '<string>',
lat: 123,
lng: 123,
deposit: 0
})
};

fetch('https://v2.api.uk.housr.com/update-property/{propertyId}', 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://v2.api.uk.housr.com/update-property/{propertyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'address' => '<string>',
'city' => '<string>',
'images' => [
'<string>'
],
'price_pw' => 123,
'bedrooms' => 1,
'bathrooms' => 1,
'postcode' => '<string>',
'lat' => 123,
'lng' => 123,
'deposit' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://v2.api.uk.housr.com/update-property/{propertyId}"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"price_pw\": 123,\n \"bedrooms\": 1,\n \"bathrooms\": 1,\n \"postcode\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123,\n \"deposit\": 0\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://v2.api.uk.housr.com/update-property/{propertyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"price_pw\": 123,\n \"bedrooms\": 1,\n \"bathrooms\": 1,\n \"postcode\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123,\n \"deposit\": 0\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v2.api.uk.housr.com/update-property/{propertyId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"price_pw\": 123,\n \"bedrooms\": 1,\n \"bathrooms\": 1,\n \"postcode\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123,\n \"deposit\": 0\n}"

response = http.request(request)
puts response.read_body
{
  "message": "Property successfully updated"
}
{
"response": "Invalid JSON in request body"
}
{
"response": "Missing or invalid authentication token"
}
{
"response": "You do not have permission to perform this action"
}
{
"response": "Property with ID 12345 not found"
}
{
"response": "Validation failed",
"errors": {
"title": [
"Title cannot be empty"
],
"price_pw": [
"Price must be a positive integer"
]
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

propertyId
integer<int64>
required

ID of the property

Body

Send only fields to modify

title
string
description
string
address
string
city
string
images
string<uri>[]

Array of image URLs, each their own comma-separated string

price_pw
integer

Weekly price as a string to preserve precision

bedrooms
integer
Required range: x >= 0
bathrooms
integer
Required range: x >= 0
postcode
string
lat
number<double> | null
lng
number<double> | null
deposit
integer
default:0

Defaults to 0 if not supplied

Response

Updated

message
string