POST
/
api
/
v1
/
onboarding
/
step-1-tenancy
Onboarding step 1 — tenancy
curl --request POST \
  --url https://api.example.com/api/v1/onboarding/step-1-tenancy
import 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_body

Overview

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 confirmed TENANCY_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.
  • currentStep is exactly 1. Submitting out of order returns 409 STATE_CONFLICT.
  • uploadId references a confirmed upload owned by the caller with fileType: 'TENANCY_DOC'.

Authentication

Bearer <accessToken> required. Scope: user.

Path parameters

None.

Query parameters

None.

Request body

FieldTypeRequiredAllowed values / ConstraintsExample
landlordIdstring | nullno24-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
landlordNamestringyes1..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
documentTypeenumyesTENANCY_AGREEMENT, RENT_STATEMENT, LANDLORD_LETTERTENANCY_AGREEMENT
uploadIdstringyes24-char ObjectId of a previously confirmed upload with fileType: 'TENANCY_DOC', owned by the caller.66400a8f1c2b4d5e6f7a8b90

Example payload

{
  "landlordId": null,                                  // 24-char ObjectId or null
  "landlordName": "Camden Council Housing",
  "documentType": "TENANCY_AGREEMENT",                 // enum: "TENANCY_AGREEMENT" | "RENT_STATEMENT" | "LANDLORD_LETTER"
  "uploadId": "66400a8f1c2b4d5e6f7a8b90"
}

Response — 200 OK

Returns the refreshed onboarding state (same shape as GET /onboarding/state).
FieldTypeAllowed valuesExample
onboardingStatusenumIN_PROGRESS, COMPLETEIN_PROGRESS
currentStepinteger | nulladvances to 22
tenancyStatusenumbecomes PENDINGPENDING

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

StatusCodeMeaning
400VALIDATION_FAILEDBody fails Zod validation (bad ObjectId shape, unknown documentType, etc.) or uploadId does not reference a TENANCY_DOC.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDuploadId does not belong to the caller (or does not exist).
409STATE_CONFLICTcurrentStep 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_verifications collection with status: PENDING, the supplied landlordName, landlordId, documentType, and uploadId.
  • Updates the user document: tenancyStatus = PENDING, tenancyVerificationId = <new id>.
  • Sets users.currentStep = 2.

See also

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"
  }'