PATCH
/
api
/
v1
/
admin
/
landlords
/
{id}
Admin update landlord
curl --request PATCH \
  --url https://api.example.com/api/v1/admin/landlords/{id}
import requests

url = "https://api.example.com/api/v1/admin/landlords/{id}"

response = requests.patch(url)

print(response.text)
const options = {method: 'PATCH'};

fetch('https://api.example.com/api/v1/admin/landlords/{id}', 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/admin/landlords/{id}",
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/admin/landlords/{id}"

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/admin/landlords/{id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/admin/landlords/{id}")

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

Activates or deactivates a landlord. Deactivated landlords disappear from the onboarding landlord autocomplete, but existing tenancy_verifications rows keep their denormalised landlordName, so historical submissions are unaffected. Deactivation is preferred over deletion to preserve referential history.

Authentication

Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated to SUPER and MODERATOR. FINANCE is read-only on the landlords surface.

Path parameters

NameTypeNotes
idstring24-char landlord ObjectId.

Request body

FieldTypeRequiredNotesExample
activebooleanyestrue to activate, false to deactivate.false
{
  "active": false
}

Response — 200 OK

Returns the updated landlord row.
{
  "id": "665f0a1b2c3d4e5f60718293",
  "name": "Leeds City Council",
  "type": "COUNCIL",
  "active": false,
  "createdAt": "2026-06-05T10:00:00.000Z",
  "updatedAt": "2026-06-05T11:30:00.000Z"
}

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDid not a 24-char ObjectId, or active missing/not boolean.
401UNAUTHENTICATEDMissing, malformed, expired, or non-admin-scope token.
403FORBIDDENAdmin authenticated but role is FINANCE (read-only).
404NOT_FOUNDNo landlord with that id.

Side effects

  • Updates landlords.active.
  • Writes a landlord.activated or landlord.deactivated admin audit-log row.

See also

curl

curl -X PATCH "https://api.swappr.co.uk/api/v1/admin/landlords/665f0a1b2c3d4e5f60718293" \
  -H "Authorization: Bearer $ADMIN_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "active": false }'