Onboarding step 1 — tenancy
curl --request POST \
--url https://api.example.com/api/v1/onboarding/step-1-tenancyimport requests
url = "https://api.example.com/api/v1/onboarding/step-1-tenancy"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/onboarding/step-1-tenancy', 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-1-tenancy",
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-1-tenancy"
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-1-tenancy")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/onboarding/step-1-tenancy")
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 1 — tenancy
Submit tenancy verification details. Step 1 of 4.
POST
/
api
/
v1
/
onboarding
/
step-1-tenancy
Onboarding step 1 — tenancy
curl --request POST \
--url https://api.example.com/api/v1/onboarding/step-1-tenancyimport requests
url = "https://api.example.com/api/v1/onboarding/step-1-tenancy"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/onboarding/step-1-tenancy', 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-1-tenancy",
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-1-tenancy"
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-1-tenancy")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/onboarding/step-1-tenancy")
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
Submits the user’s tenancy verification details: the landlord name (or curated landlord id once the registry is populated in Phase 6), the document type, and a reference to a previously confirmedTENANCY_DOC upload.
The server creates a tenancy_verifications row in PENDING, links it to the user, sets tenancyStatus = PENDING, and advances currentStep from 1 to 2. Tenancy approval is asynchronous — admin review lands in Phase 6; until then a row sits in PENDING and downstream gates (POST /current-home/me/publish) return 409 STATE_CONFLICT.
Preconditions:
- The caller is authenticated.
currentStepis exactly1. Submitting out of order returns409 STATE_CONFLICT.uploadIdreferences a confirmed upload owned by the caller withfileType: 'TENANCY_DOC'.
Authentication
Bearer <accessToken> required. Scope: user.
Path parameters
None.Query parameters
None.Request body
| Field | Type | Required | Allowed values / Constraints | Example |
|---|---|---|---|---|
landlordId | string | null | no | 24-char MongoDB ObjectId. Pass when the user selected an entry from /onboarding/landlords; otherwise omit or send null. When set, it must reference an active landlord or the request is rejected with 400 VALIDATION_FAILED. | null |
landlordName | string | yes | 1..200 chars. Used as the free-text fallback when landlordId is null. When landlordId IS set, the server overwrites this with the landlord’s canonical name, so any client value is ignored. | Camden Council Housing |
documentType | enum | null | no | TENANCY_AGREEMENT, RENT_STATEMENT, LANDLORD_LETTER. Omit or send null when the user skipped the document. | TENANCY_AGREEMENT |
uploadId | string | null | no | 24-char ObjectId of a previously confirmed upload with fileType: 'TENANCY_DOC', owned by the caller. Omit or send null when the user skipped the upload. Requires documentType to be set. | 66400a8f1c2b4d5e6f7a8b90 |
landlordName is required. The document type and the proof upload are
both optional: an applicant may name their landlord and submit nothing else.
That still creates the PENDING verification and still puts the finished
profile in front of a reviewer, who can approve on the rest of the profile or
reject with steps: ['TENANCY'] to ask for the document. Sending an
uploadId with no documentType is rejected — the reviewer would have no
idea what the file is meant to be.
Example payload
{
"landlordId": null, // 24-char ObjectId or null
"landlordName": "Camden Council Housing",
"documentType": "TENANCY_AGREEMENT", // enum: "TENANCY_AGREEMENT" | "RENT_STATEMENT" | "LANDLORD_LETTER" | null
"uploadId": "66400a8f1c2b4d5e6f7a8b90"
}
Example payload — skipping the document
{
"landlordId": "66400a8f1c2b4d5e6f7a8b01",
"landlordName": "Camden Council Housing"
}
Response — 200 OK
Returns the refreshed onboarding state (same shape asGET /onboarding/state).
| Field | Type | Allowed values | Example |
|---|---|---|---|
onboardingStatus | enum | IN_PROGRESS, COMPLETE | IN_PROGRESS |
currentStep | integer | null | advances to 2 | 2 |
tenancyStatus | enum | becomes PENDING | PENDING |
Example response
{
"onboardingStatus": "IN_PROGRESS", // enum: "IN_PROGRESS" | "COMPLETE"
"currentStep": 2, // integer 1..4 or null when COMPLETE
"tenancyStatus": "PENDING" // enum: "NOT_SUBMITTED" | "PENDING" | "APPROVED" | "REJECTED"
}
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Body fails Zod validation (bad ObjectId shape, unknown documentType, uploadId sent without documentType, etc.) or uploadId does not reference a TENANCY_DOC. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 404 | NOT_FOUND | uploadId does not belong to the caller (or does not exist). |
| 409 | STATE_CONFLICT | currentStep is not 1, or onboarding is already complete. |
Example error — 409
{
"type": "https://api.swappr.co.uk/errors/state-conflict",
"title": "State conflict",
"status": 409,
"code": "STATE_CONFLICT",
"detail": "Complete step 0 first (current step is 2)",
"instance": "/api/v1/onboarding/step-1-tenancy",
"requestId": "01HZQ7K3M4N5P6Q7R8S9T0V1W2"
}
Side effects
- Inserts a row into the
tenancy_verificationscollection withstatus: PENDING, the suppliedlandlordName,landlordId,documentType, anduploadId— the last two stored asnullwhen the applicant skipped them. - Updates the user document:
tenancyStatus = PENDING,tenancyVerificationId = <new id>. - Sets
users.currentStep = 2.
See also
- Onboarding state machine
- Upload flow — how to obtain the
uploadId. - Presign upload URLs
- Confirm uploads
- Step 2 — current home
curl
curl -X POST https://api.swappr.co.uk/api/v1/onboarding/step-1-tenancy \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"landlordId": null,
"landlordName": "Camden Council Housing",
"documentType": "TENANCY_AGREEMENT",
"uploadId": "66400a8f1c2b4d5e6f7a8b90"
}'