Onboarding step 3 — photos
curl --request POST \
--url https://api.example.com/api/v1/onboarding/step-3-photosimport 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_bodyOnboarding
Onboarding step 3 — photos
Attach confirmed HOME_PHOTO uploads to the listing and pick a cover. Step 3 of 4.
POST
/
api
/
v1
/
onboarding
/
step-3-photos
Onboarding step 3 — photos
curl --request POST \
--url https://api.example.com/api/v1/onboarding/step-3-photosimport 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_bodyOverview
Attaches the user’s confirmedHOME_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:
currentStepis exactly3.- A step-2 listing exists with
photos.length === 0. - Every
photoUploadIdreferences a confirmed upload owned by the caller withfileType: 'HOME_PHOTO'. coverPhotoIdis one ofphotoUploadIds.- Total photo count would not exceed 10.
Authentication
Bearer <accessToken> required. Scope: user.
Path parameters
None.Query parameters
None.Request body
| Field | Type | Required | Allowed values / Constraints | Example |
|---|---|---|---|---|
photoUploadIds | string[] | yes | 1..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"] |
coverPhotoId | string | yes | 24-char ObjectId. Must equal exactly one entry in photoUploadIds. | 66400a8f1c2b4d5e6f7a8b91 |
photoMeta | object[] | no | Up 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
| Field | Type | Required | Constraints |
|---|---|---|---|
uploadId | string | yes | 24-char ObjectId; should match an entry in photoUploadIds. |
blurhash | string | yes | BlurHash 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. |
width | integer | yes | Cropped width in px, > 0. |
height | integer | yes | Cropped 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 asGET /onboarding/state). currentStep stays 3 until the description is also submitted.
| Field | Type | Allowed values | Example |
|---|---|---|---|
onboardingStatus | enum | IN_PROGRESS, COMPLETE | IN_PROGRESS |
currentStep | integer | null | stays 3 until description posted | 3 |
tenancyStatus | enum | unchanged | PENDING |
Example response
{
"onboardingStatus": "IN_PROGRESS",
"currentStep": 3,
"tenancyStatus": "PENDING"
}
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Body fails Zod validation; coverPhotoId not in photoUploadIds; one of the uploads is not a HOME_PHOTO; or the resulting photo count would exceed 10. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 404 | NOT_FOUND | One or more photoUploadIds do not belong to the caller (or do not exist). |
| 409 | STATE_CONFLICT | currentStep 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_homesdocument (url,thumbnailUrl,orderIndex,isCover,fileSizeBytes). WhenphotoMetais supplied,blurhash,width, andheightare stored from it; otherwise they default to""/0/0. - Exactly one photo is marked
isCover: true— the entry whose id matchescoverPhotoId. - Does NOT advance
currentStepon its own — only the description PATCH does that.
See also
- Step 3 — description
- Upload flow — how to obtain the
photoUploadIds. - Presign upload URLs
- Confirm uploads
- Add listing photos (post-onboarding)
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"
}'