DELETE
/
api
/
v1
/
admin
/
listings
/
:id
Delete listing
curl --request DELETE \
  --url https://api.example.com/api/v1/admin/listings/:id
import requests

url = "https://api.example.com/api/v1/admin/listings/:id"

response = requests.delete(url)

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

fetch('https://api.example.com/api/v1/admin/listings/: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/listings/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$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/listings/:id"

req, _ := http.NewRequest("DELETE", url, nil)

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.example.com/api/v1/admin/listings/:id")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body

Overview

Soft-deletes a current-home listing. It:
  1. Sets current_homes.deletedAt = now (the row is preserved for audit; it just disappears from the public surface and the admin list).
  2. Enqueues a match recompute for the owner so any matches anchored on this listing are torn down.
Idempotent: re-deleting an already-deleted row returns the existing row without re-firing the recompute.

Authentication

Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated: requires SUPER or MODERATOR. A FINANCE admin receives 403 FORBIDDEN.

Path parameters

NameTypeRequiredNotesExample
idstringyesListing ObjectId, 1..64 chars.66400a8f1c2b4d5e6f7ad000

Query parameters

None.

Request body

None.

Response — 200 OK

Returns the listing row with deletedAt set.
{
  "id": "66400a8f1c2b4d5e6f7ad000",
  "userId": "66400a8f1c2b4d5e6f7a8b01",
  "status": "HIDDEN",
  "propertyType": "FLAT",
  "bedrooms": 2,
  "bathrooms": 1,
  "address": "12 Example Street",
  "postcode": "E1 6AN",
  "rentMonthlyMinor": 180000,
  "photoCount": 6,
  "coverPhotoUrl": null,
  "deletedAt": "2026-05-23T11:20:00.000Z",
  "createdAt": "2026-05-01T10:00:00.000Z",
  "owner": { "id": "66400a8f1c2b4d5e6f7a8b01", "email": "jane@example.com", "firstName": "Jane", "lastName": "Doe" }
}

Error responses

StatusCodeMeaning
401UNAUTHENTICATEDMissing, malformed, expired, or non-admin-scope token.
403FORBIDDENCaller is a FINANCE admin.
404NOT_FOUNDNo listing with that id.

Example error — 403 FORBIDDEN

{
  "type": "https://api.swappr.co.uk/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "code": "FORBIDDEN",
  "detail": "Admin role FINANCE is not permitted for this action",
  "instance": "/api/v1/admin/listings/66400a8f1c2b4d5e6f7ad000",
  "requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}

Side effects

  • current_homes.deletedAt set (soft delete — the row and its photos are retained).
  • A match-recompute job is enqueued for the owner (only on the first delete; idempotent re-deletes skip it).
  • Audit-log row written (action listings.delete).

See also

curl

curl -X DELETE https://api.swappr.co.uk/api/v1/admin/listings/66400a8f1c2b4d5e6f7ad000 \
  -H "Authorization: Bearer $ADMIN_ACCESS_TOKEN"

Postman

See docs/postman/swappr.postman_collection.jsonAdmin Listings → Delete.