Admin update landlord
Landlords
Admin update landlord
Activate or deactivate a landlord in the curated reference list.
PATCH
Admin update landlord
Overview
Activates or deactivates a landlord. Deactivated landlords disappear from the onboarding landlord autocomplete, but existingtenancy_verifications rows keep their denormalised landlordName, so historical submissions are unaffected. Deactivation is preferred over deletion to preserve referential history.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated to SUPER and MODERATOR. FINANCE is read-only on the landlords surface.
Path parameters
| Name | Type | Notes |
|---|---|---|
id | string | 24-char landlord ObjectId. |
Request body
| Field | Type | Required | Notes | Example |
|---|---|---|---|---|
active | boolean | yes | true to activate, false to deactivate. | false |
Response — 200 OK
Returns the updated landlord row.
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | id not a 24-char ObjectId, or active missing/not boolean. |
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
| 403 | FORBIDDEN | Admin authenticated but role is FINANCE (read-only). |
| 404 | NOT_FOUND | No landlord with that id. |
Side effects
- Updates
landlords.active. - Writes a
landlord.activatedorlandlord.deactivatedadmin audit-log row.