Landlord Management
Landlord Management
The landlord module provides a data model and API layer for managing landlord records within your organisation. Landlords are a core stakeholder entity referenced across properties, tenancies, offers, compliance workflows, and the branded landlord portal.
Data Model
Each landlord record is scoped to an organisation (orgId) and optionally to a branch (branchId).
Field Reference
Contact Details
| Field | Type | Notes |
|---|---|---|
title | string (optional) | e.g. Mr, Mrs, Dr |
firstName | string (required) | Max 100 chars |
lastName | string (required) | Max 100 chars |
email | string (required) | Used for portal access and communications |
phone | string (optional) | Primary phone number |
altPhone | string (optional) | Secondary / alternative phone |
Landlord Type
| Field | Type | Notes |
|---|---|---|
landlordType | "individual" | "company" | Defaults to individual |
companyName | string (optional) | Required when type is company |
companyRegistrationNumber | string (optional) | Companies House number |
Address
| Field | Type | Notes |
|---|---|---|
addressLine1 | string (optional) | |
addressLine2 | string (optional) | |
city | string (optional) | |
county | string (optional) | |
postcode | string (optional) | |
country | string (optional) | Defaults to GB |
Communication Preferences
| Field | Type | Default |
|---|---|---|
preferredContactMethod | "email" | "phone" | "post" | "email" |
emailNotificationsEnabled | boolean | true |
smsNotificationsEnabled | boolean | false |
Portal Access
| Field | Type | Default |
|---|---|---|
portalAccessEnabled | boolean | false |
portalTokenId | string (optional) | ID of the associated landlordPortalToken |
Financial
| Field | Type | Notes |
|---|---|---|
bankAccountName | string (optional) | Account name for rent payments |
bankSortCode | string (optional) | Max 10 chars |
bankAccountNumber | string (optional) | Max 20 chars |
taxReference | string (optional) | UTR or tax reference |
isOverseas | boolean | Marks landlord as non-UK resident (NRL scheme). Defaults to false |
Status & Tracking
| Field | Type | Notes |
|---|---|---|
status | "active" | "inactive" | "archived" | Defaults to active |
notes | string (optional) | Internal agent notes, max 5,000 chars |
managedByUserId | string (optional) | The agent user responsible for this landlord |
createdByUserId | string (optional) | User who created the record |
API Reference
All procedures are accessed via the landlord tRPC router namespace.
landlord.list
Returns a cursor-paginated list of landlords for the authenticated organisation.
Input
{
cursor?: string; // Cursor for pagination
limit?: number; // Page size
search?: string; // Searches firstName, lastName, email, companyName, postcode
status?: "active" | "inactive" | "archived";
landlordType?: "individual" | "company";
branchId?: string;
managedByUserId?: string;
}
Returns: Paginated list of landlord records.
landlord.get
Returns a single landlord record by ID, including a count of linked properties.
Input
{
id: string; // Landlord ID
}
Returns: Landlord record with an additional propertyCount field.
Errors: NOT_FOUND if the landlord does not exist or belongs to a different org.
landlord.create
Creates a new landlord record.
Input
{
firstName: string; // Required
lastName: string; // Required
email: string; // Required, must be a valid email
title?: string;
phone?: string;
altPhone?: string;
landlordType?: "individual" | "company"; // Default: "individual"
companyName?: string;
companyRegistrationNumber?: string;
addressLine1?: string;
addressLine2?: string;
city?: string;
county?: string;
postcode?: string;
country?: string; // Default: "GB"
preferredContactMethod?: "email" | "phone" | "post"; // Default: "email"
emailNotificationsEnabled?: boolean; // Default: true
smsNotificationsEnabled?: boolean; // Default: false
bankAccountName?: string;
bankSortCode?: string;
bankAccountNumber?: string;
taxReference?: string;
isOverseas?: boolean; // Default: false
notes?: string;
managedByUserId?: string;
branchId?: string;
}
Returns: The newly created landlord record. Produces an audit log entry.
landlord.update
Partially updates an existing landlord record. All fields except id are optional.
Input
{
id: string; // Required — landlord to update
// ... any subset of create fields, plus:
portalAccessEnabled?: boolean;
status?: "active" | "inactive" | "archived";
}
Returns: Updated landlord record. Produces an audit log entry.
Notes: Includes an ownership check — the caller must have access to the record within their org.
landlord.archive
Soft-deletes a landlord by setting their status to "archived".
Input
{
id: string;
}
Returns: Updated landlord record. Produces an audit log entry.
landlord.listProperties
Returns all properties linked to a given landlord.
Input
{
id: string; // Landlord ID
}
Returns: Array of property records associated with this landlord.
landlord.anonymise
Performs a GDPR data subject erasure request. Replaces all PII fields with redacted placeholder values. Admin-only.
Input
{
id: string; // Landlord ID
}
Returns: Updated (anonymised) landlord record. Produces an audit log entry.
⚠️ This action is irreversible. All personally identifiable information is permanently overwritten.
Status Lifecycle
active ──► inactive ──► archived
└──────────────────────►┘
Use landlord.archive to move a landlord to the archived status. To restore an archived landlord, use landlord.update with status: "active" or "inactive".
GDPR Considerations
The landlord.anonymise procedure satisfies GDPR right-to-erasure requests. It is restricted to admin users and replaces PII (name, email, phone, address, financial details) with redacted placeholders while preserving the record shell for referential integrity with linked properties and tenancies.