Admin create landlord
curl --request POST \
--url https://api.example.com/api/v1/admin/landlordsimport requests
url = "https://api.example.com/api/v1/admin/landlords"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/admin/landlords', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/admin/landlords")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/landlords")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyLandlords
Admin create landlord
Add a council or housing association to the curated landlords reference list.
POST
/
api
/
v1
/
admin
/
landlords
Admin create landlord
curl --request POST \
--url https://api.example.com/api/v1/admin/landlordsimport requests
url = "https://api.example.com/api/v1/admin/landlords"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/admin/landlords', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/admin/landlords")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/landlords")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOverview
Adds a landlord to the curated reference list so it appears in the onboarding landlord autocomplete. Use this to fill gaps the seed data missed, without redeploying.Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated to SUPER and MODERATOR. FINANCE is read-only on the landlords surface.
Request body
| Field | Type | Required | Constraints | Example |
|---|---|---|---|---|
name | string | yes | 1..200 chars, trimmed. Must be unique (case-insensitive). | Leeds City Council |
type | enum | yes | COUNCIL or HOUSING_ASSOCIATION. | COUNCIL |
{
"name": "Leeds City Council",
"type": "COUNCIL"
}
Response — 201 Created
Returns the created landlord row (id, name, type, active, createdAt, updatedAt). active defaults to true.
{
"id": "665f0a1b2c3d4e5f60718293",
"name": "Leeds City Council",
"type": "COUNCIL",
"active": true,
"createdAt": "2026-06-05T10:00:00.000Z",
"updatedAt": "2026-06-05T10:00:00.000Z"
}
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Missing/blank name, or type not in the allowed set. |
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
| 403 | FORBIDDEN | Admin authenticated but role is FINANCE (read-only). |
| 409 | STATE_CONFLICT | A landlord with that name already exists. |
Side effects
- Inserts a row into the
landlordscollection. - Writes a
landlord.createdadmin audit-log row.
See also
curl
curl -X POST "https://api.swappr.co.uk/api/v1/admin/landlords" \
-H "Authorization: Bearer $ADMIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Leeds City Council", "type": "COUNCIL" }'