PATCH
/
api
/
v1
/
current-home
/
me
/
photos
/
reorder
Reorder photos
curl --request PATCH \
  --url https://api.example.com/api/v1/current-home/me/photos/reorder
import requests

url = "https://api.example.com/api/v1/current-home/me/photos/reorder"

response = requests.patch(url)

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

fetch('https://api.example.com/api/v1/current-home/me/photos/reorder', 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/reorder",
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/reorder"

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/reorder")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/current-home/me/photos/reorder")

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

Updates the display order of photos on the caller’s current-home listing. The client sends a list of { photoId, orderIndex } pairs; the server $sets each pair atomically against the embedded current_homes.photos[] subdocuments. Every photoId in the payload must already exist on the caller’s listing — unknown ids return 404 NOT_FOUND. The cover flag (isCover) is not changed by this endpoint; use Set cover photo for that. Partial reorders are allowed: photos you do not include in the payload keep their existing orderIndex. If you submit overlapping orderIndex values across photos the server still writes them as-is — the client is responsible for sending a sensible permutation.

Authentication

Bearer <accessToken> required. Scope: user.

Path parameters

None.

Query parameters

None.

Request body

FieldTypeRequiredAllowed values / ConstraintsExample
orderobject[]yes1..10 entries. See OrderEntry object.

OrderEntry object

FieldTypeRequiredNotes / ConstraintsExample
photoIdstringyes24-char ObjectId of an existing embedded photo on the caller’s listing.66400a8f1c2b4d5e6f7a8d01
orderIndexintegeryes0..9 inclusive. Lower = earlier in the gallery.0

Example payload

{
  "order": [
    { "photoId": "66400a8f1c2b4d5e6f7a8d03", "orderIndex": 0 },
    { "photoId": "66400a8f1c2b4d5e6f7a8d01", "orderIndex": 1 },
    { "photoId": "66400a8f1c2b4d5e6f7a8d02", "orderIndex": 2 }
  ]
}

Response — 200 OK

Returns the updated Home object with the new photos[].orderIndex values applied.
{
  "home": {
    "id": "66400a8f1c2b4d5e6f7a8c00",
    "photos": [
      {
        "id": "66400a8f1c2b4d5e6f7a8d03",
        "url": "https://cdn.swappr.co.uk/listings/.../photo3.jpg",
        "thumbnailUrl": "https://cdn.swappr.co.uk/listings/.../photo3.jpg",
        "orderIndex": 0,
        "isCover": false,
        "fileSizeBytes": 2100000,
        "width": 0,
        "height": 0,
        "blurhash": "",
        "createdAt": "2026-05-22T14:32:08.412Z"
      }
      // ...other photos sorted by their new orderIndex
    ]
    // ...rest of the home shape (see GET /current-home/me)
  }
}

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDorder empty, > 10 entries, a photoId is not a 24-char ObjectId, or an orderIndex is outside 0..9.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDThe user has no current_homes listing, or a 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": "photoId 66400a8f1c2b4d5e6f7a8d99 not in this listing",
  "instance": "/api/v1/current-home/me/photos/reorder",
  "requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}

Side effects

  • $sets photos.$.orderIndex for each pair on the caller’s current_homes document.
  • updatedAt is bumped.
  • No image.process job is enqueued (no new bytes).
  • No match.recompute is triggered (photo order does not affect matching).

See also

curl

curl -X PATCH https://api.swappr.co.uk/api/v1/current-home/me/photos/reorder \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "order": [
      { "photoId": "66400a8f1c2b4d5e6f7a8d03", "orderIndex": 0 },
      { "photoId": "66400a8f1c2b4d5e6f7a8d01", "orderIndex": 1 },
      { "photoId": "66400a8f1c2b4d5e6f7a8d02", "orderIndex": 2 }
    ]
  }'