Set cover photo
curl --request PATCH \
--url https://api.example.com/api/v1/current-home/me/photos/{photoId}/coverimport requests
url = "https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover', 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/photos/{photoId}/cover",
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/photos/{photoId}/cover"
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/photos/{photoId}/cover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover")
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_bodyCurrent Home
Set cover photo
Promote one of the caller’s listing photos to be the cover. Idempotent.
PATCH
/
api
/
v1
/
current-home
/
me
/
photos
/
{photoId}
/
cover
Set cover photo
curl --request PATCH \
--url https://api.example.com/api/v1/current-home/me/photos/{photoId}/coverimport requests
url = "https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover', 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/photos/{photoId}/cover",
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/photos/{photoId}/cover"
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/photos/{photoId}/cover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/current-home/me/photos/{photoId}/cover")
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_bodyOverview
Marks the photo identified byphotoId as the cover photo on the caller’s current-home listing. In a single atomic write the server sets isCover: false on every other photo and isCover: true on the target — there is always exactly one cover photo while photos.length > 0.
The endpoint is idempotent: calling it with the current cover photo’s id is a no-op that returns the same listing.
The cover photo is the one used as the gallery thumbnail in match cards and in conversation post-share previews — it has no effect on matching scores.
Authentication
Bearer <accessToken> required. Scope: user.
Path parameters
| Field | Type | Required | Notes / Constraints | Example |
|---|---|---|---|---|
photoId | string | yes | 24-char ObjectId of an existing embedded photo on the caller’s listing. | 66400a8f1c2b4d5e6f7a8d02 |
Query parameters
None.Request body
None.Response — 200 OK
Returns the updated Home object. Exactly one photo will haveisCover: true.
{
"home": {
"id": "66400a8f1c2b4d5e6f7a8c00",
"photos": [
{
"id": "66400a8f1c2b4d5e6f7a8d01",
"url": "https://cdn.swappr.co.uk/listings/.../photo1.jpg",
"thumbnailUrl": "https://cdn.swappr.co.uk/listings/.../photo1.jpg",
"orderIndex": 0,
"isCover": false,
"fileSizeBytes": 2500000,
"width": 0,
"height": 0,
"blurhash": "",
"createdAt": "2026-05-22T14:32:08.412Z"
},
{
"id": "66400a8f1c2b4d5e6f7a8d02",
"url": "https://cdn.swappr.co.uk/listings/.../photo2.jpg",
"thumbnailUrl": "https://cdn.swappr.co.uk/listings/.../photo2.jpg",
"orderIndex": 1,
"isCover": true,
"fileSizeBytes": 2300000,
"width": 0,
"height": 0,
"blurhash": "",
"createdAt": "2026-05-22T14:32:08.512Z"
}
]
// ...rest of the home shape (see GET /current-home/me)
}
}
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | photoId is not a 24-char hex ObjectId. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 404 | NOT_FOUND | The user has no current_homes listing, or photoId does not match any photo on this listing. |
Example error — 404
{
"type": "https://api.swappr.co.uk/errors/not-found",
"title": "Not found",
"status": 404,
"code": "NOT_FOUND",
"detail": "photo not found on this listing",
"instance": "/api/v1/current-home/me/photos/66400a8f1c2b4d5e6f7a8d99/cover",
"requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}
Side effects
$setsphotos.$[].isCover = falsefor every photo on the listing, then$setsisCover = trueon the matched photo — both in one Mongo update.updatedAtis bumped.- No
match.recomputeis triggered (cover photo does not affect matching).
See also
curl
curl -X PATCH https://api.swappr.co.uk/api/v1/current-home/me/photos/66400a8f1c2b4d5e6f7a8d02/cover \
-H "Authorization: Bearer $ACCESS_TOKEN"