POST
/
api
/
v1
/
onboarding
/
step-3-photos
Onboarding step 3 — photos
curl --request POST \
  --url https://api.example.com/api/v1/onboarding/step-3-photos
import requests

url = "https://api.example.com/api/v1/onboarding/step-3-photos"

response = requests.post(url)

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

fetch('https://api.example.com/api/v1/onboarding/step-3-photos', 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/onboarding/step-3-photos",
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/onboarding/step-3-photos"

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

url = URI("https://api.example.com/api/v1/onboarding/step-3-photos")

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_body

Overview

Attaches the user’s confirmed HOME_PHOTO uploads to the listing created in step 2, and designates which one is the cover photo. This endpoint is a one-shot during onboarding — the listing is created with photos: [] and step 3 appends them in a single call. After step 3 has fired, further photo edits go through the post-onboarding photo endpoints (POST /current-home/me/photos, PATCH /current-home/me/photos/reorder, etc.). Re-submitting step 3 returns 409 STATE_CONFLICT. currentStep stays at 3 until both photos AND description are submitted — only then does it advance to 4. Preconditions:
  • currentStep is exactly 3.
  • A step-2 listing exists with photos.length === 0.
  • Every photoUploadId references a confirmed upload owned by the caller with fileType: 'HOME_PHOTO'.
  • coverPhotoId is one of photoUploadIds.
  • Total photo count would not exceed 10.

Authentication

Bearer <accessToken> required. Scope: user.

Path parameters

None.

Query parameters

None.

Request body

FieldTypeRequiredAllowed values / ConstraintsExample
photoUploadIdsstring[]yes1..10 entries. Each is a 24-char ObjectId of a previously confirmed HOME_PHOTO upload owned by the caller. Array order becomes initial orderIndex.["66400a8f1c2b4d5e6f7a8b91", "66400a8f1c2b4d5e6f7a8b92"]
coverPhotoIdstringyes24-char ObjectId. Must equal exactly one entry in photoUploadIds.66400a8f1c2b4d5e6f7a8b91
photoMetaobject[]noUp to 10 per-photo display-metadata entries, computed client-side after cropping. Keyed by uploadId; entries whose uploadId is not in photoUploadIds are ignored. When omitted, photos are stored with an empty blurhash and 0×0 dimensions.see below

photoMeta[] object

FieldTypeRequiredConstraints
uploadIdstringyes24-char ObjectId; should match an entry in photoUploadIds.
blurhashstringyesBlurHash placeholder string, 1..120 chars. The client computes it from the cropped image; the app paints it as a progressive placeholder before the full photo loads.
widthintegeryesCropped width in px, > 0.
heightintegeryesCropped height in px, > 0.

Example payload

{
  "photoUploadIds": [
    "66400a8f1c2b4d5e6f7a8b91",
    "66400a8f1c2b4d5e6f7a8b92",
    "66400a8f1c2b4d5e6f7a8b93"
  ],
  "coverPhotoId": "66400a8f1c2b4d5e6f7a8b91",  // must be one of photoUploadIds
  "photoMeta": [                                // optional — progressive placeholders
    {
      "uploadId": "66400a8f1c2b4d5e6f7a8b91",
      "blurhash": "L6PZfSi_.AyE_3t7t7R**0o#DgR4",
      "width": 1600,
      "height": 1200
    }
  ]
}

Response — 200 OK

Returns the refreshed onboarding state (same shape as GET /onboarding/state). currentStep stays 3 until the description is also submitted.
FieldTypeAllowed valuesExample
onboardingStatusenumIN_PROGRESS, COMPLETEIN_PROGRESS
currentStepinteger | nullstays 3 until description posted3
tenancyStatusenumunchangedPENDING

Example response

{
  "onboardingStatus": "IN_PROGRESS",
  "currentStep": 3,
  "tenancyStatus": "PENDING"
}

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDBody fails Zod validation; coverPhotoId not in photoUploadIds; one of the uploads is not a HOME_PHOTO; or the resulting photo count would exceed 10.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDOne or more photoUploadIds do not belong to the caller (or do not exist).
409STATE_CONFLICTcurrentStep is not 3; no step-2 listing exists yet; or photos have already been submitted (use the post-onboarding photo endpoints).

Example error — 400

{
  "type": "https://api.swappr.co.uk/errors/validation-failed",
  "title": "Validation failed",
  "status": 400,
  "code": "VALIDATION_FAILED",
  "detail": "coverPhotoId must be one of photoUploadIds",
  "instance": "/api/v1/onboarding/step-3-photos",
  "requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}

Side effects

  • Appends each photo as an embedded subdocument on the user’s current_homes document (url, thumbnailUrl, orderIndex, isCover, fileSizeBytes). When photoMeta is supplied, blurhash, width, and height are stored from it; otherwise they default to ""/0/0.
  • Exactly one photo is marked isCover: true — the entry whose id matches coverPhotoId.
  • Does NOT advance currentStep on its own — only the description PATCH does that.

See also

curl

curl -X POST https://api.swappr.co.uk/api/v1/onboarding/step-3-photos \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "photoUploadIds": [
      "66400a8f1c2b4d5e6f7a8b91",
      "66400a8f1c2b4d5e6f7a8b92",
      "66400a8f1c2b4d5e6f7a8b93"
    ],
    "coverPhotoId": "66400a8f1c2b4d5e6f7a8b91"
  }'