Estates API
Manage individual rental units: apartments, studios, houses, or commercial spaces. Estates are the units you create leases for.
Quick Example
Code
Common Workflows
List all units in a building
GET /api/places/{place_id}/estates: Returns all apartments in the building
Prepare a unit for leasing
POST /api/places/{id}/estates: Create the estatePOST /api/places/{id}/estates/{id}/rooms: Add rooms (Rooms API)POST /api/leases: Create a lease for this estate (Leases API)
Track renovation
PUT /api/places/{id}/estates/{id}: Updaterenovation_dateandother_detail- Energy diagnosis may need updating after renovation (Energy Diagnosis API)
Retire a unit (leases all terminated)
PUT /api/estates/{id}/archive: Archive the vacant unit (frees a quota slot; deletion would be blocked by lease history)GET /api/estates/archived: Review archived unitsPUT /api/estates/{id}/unarchive: Bring it back later (subject to quota)
Overview
Estates are individual property units that belong to places (buildings or complexes). Each estate contains:
- Physical Attributes: Area, rooms, orientation, floor
- Financial Information: Taxes, acquisition price, property values
- Legal Details: Lot numbers, fiscal identifiers
- Ownership: Current and previous owner tracking
- Room Management: Nested room structure for detailed space management
- Energy Diagnostics: Energy performance assessments
Authentication
All endpoints require authentication with the following permissions:
- PropertiesRead: For GET operations
- PropertiesWrite: For POST and PUT operations
- PropertiesDelete: For DELETE operations
Base URL
Estate endpoints are nested under places: /api/places/{place_id}/estates
Core Estate Operations
List Estates
GET /api/places/{place_id}/estates
Retrieve all estates belonging to a specific place.
Path Parameters:
place_id(UUID): The place ID
Response:
Code
Create Estate
POST /api/places/{place_id}/estates
Create a new estate within a place.
Path Parameters:
place_id(UUID): The place ID
Request Body:
Code
Response: 201 Created
Returns the created estate object with generated ID and timestamps.
Get Estate
GET /api/places/{place_id}/estates/{estate_id}
Retrieve a specific estate by ID within a place.
Path Parameters:
place_id(UUID): The place IDestate_id(UUID): The estate ID
Response: 200 OK
Returns the estate object.
Update Estate
PUT /api/places/{place_id}/estates/{estate_id}
Update an existing estate. All fields are optional in update requests.
Path Parameters:
place_id(UUID): The place IDestate_id(UUID): The estate ID
Request Body:
Code
Response: 200 OK
Returns the updated estate object.
Delete Estate
DELETE /api/places/{place_id}/estates/{estate_id}
Delete an estate from a place.
Path Parameters:
place_id(UUID): The place IDestate_id(UUID): The estate ID
Response: 204 No Content
Deletion is only for genuine mistakes. An estate that is (or ever was) referenced by a lease cannot be deleted: the request returns
409 Conflict, even when every lease isTERMINATED, because lease history is protected. To take a unit out of your active portfolio without losing its history, archive it instead (see below).
Archiving
Archiving takes an estate out of your active portfolio without deleting it. An archived estate:
- keeps all its history (leases, documents, timestamps): nothing is removed;
- disappears from the default listings (
GET /api/estatesandGET /api/places/{place_id}/estatesonly return non-archived estates); - no longer counts toward your
estatequota, so archiving a unit frees a slot on your plan.
This is the intended way to retire a unit whose leases are all terminated: the case where deletion is blocked by the 409 Conflict above.
Archiving is an orthogonal flag (archived_at), not a status change: rental_status is untouched.
Archive an Estate
PUT /api/estates/{id}/archive (flat route)
PUT /api/places/{place_id}/estates/{estate_id}/archive (nested route)
Archive a vacant estate. Only estates with rental_status of VACANT (no active or in-notice lease) can be archived.
Response: 200 OK: returns the estate with archived_at set.
Code
Archiving is idempotent: archiving an already-archived estate returns 200 OK with the original archived_at unchanged.
Errors:
422 Unprocessable Entity: the estate isRENTEDorNOTICE(only vacant estates can be archived).
Unarchive an Estate
PUT /api/estates/{id}/unarchive (flat route)
Bring an archived estate back into the active portfolio. Because the estate re-enters the estate quota, this endpoint is quota-gated exactly like creation.
Response: 200 OK: returns the estate with archived_at set back to null.
Errors:
403 Forbidden:PLAN_LIMIT_REACHED: unarchiving would exceed your plan's active-estate limit. Free a slot (archive another unit or upgrade) and retry.
Code
List Archived Estates
GET /api/estates/archived
Returns all archived estates for the tenant, most recently archived first.
Response: 200 OK: an array of estate objects (each with archived_at set).
Nested Resources
Rooms Management
See Rooms API for detailed room operations within estates.
Estates can contain multiple rooms accessed through:
- GET
/api/places/{place_id}/estates/{estate_id}/rooms - POST
/api/places/{place_id}/estates/{estate_id}/rooms - And other room-specific endpoints
Energy Diagnostics
See Energy Diagnosis API for energy performance assessments.
Energy diagnostics for estates accessed through:
- GET
/api/places/{place_id}/estates/{estate_id}/energy-diagnoses
Data Types and Structures
Estate Object
| Field | Type | Description |
|---|---|---|
id | UUID | Generated estate ID |
name | string | Property name (e.g. "T3 - Apt 401") |
place_id | UUID | Parent place ID |
estate_type_id | UUID | Reference to estate type |
area | number | Area in square meters |
number_of_room | integer | Number of rooms |
orientation | string | Compass orientation |
building | string | Building identifier |
floor | integer | Floor number |
owner_id | UUID | Current owner ID |
previous_owner_id | UUID | Previous owner ID |
lot_number | string | Legal lot number |
fiscal_identifier | string | Tax/fiscal identifier |
housing_tax | number | Annual housing tax |
property_tax | number | Annual property tax |
acquisition_price | number | Purchase price |
rent_amount | number | Reference rent amount (euros). Auto-synced with active leases. |
rental_status | enum | VACANT, RENTED, NOTICE. Auto-synced with lease status. |
construction_date | datetime | Construction date |
renovation_date | datetime | Last renovation date |
address | string | Full address |
other_detail | string | Additional details |
created_at | datetime | Creation timestamp |
updated_at | datetime | Last update timestamp |
archived_at | datetime | null | Archive timestamp. null = active (counts toward quota); set = archived (out of quota, hidden from default listings). See Archiving. |
Required Fields for Creation
name (1-255 chars), estate_type_id, area, fiscal_identifier (1-50 chars)
Update Estate Request
All fields are optional. Absent fields are preserved, null removes the value. The place_id field can be changed via the flat route PUT /estates/{id} to move a property to another place.
Common Orientations
Typical values for the orientation field:
NorthSouthEastWestNorth-EastNorth-WestSouth-EastSouth-West
Error Responses
Validation Errors
400 Bad Request
Code
Not Found
404 Not Found
Code
Place Validation Error
When estate doesn't belong to the specified place:
Code
Common Use Cases
Creating a New Apartment
- Identify the parent place (building)
- Choose appropriate estate type (apartment)
- Create estate with
POST /api/places/{place_id}/estates - Add rooms using the rooms API
- Attach energy diagnostics if required
Property Tax Management
- Get estate with
GET /api/places/{place_id}/estates/{estate_id} - Update tax values with
PUT /api/places/{place_id}/estates/{estate_id} - Track historical changes through timestamps
Renovation Tracking
- Update
renovation_datewhen work is completed - Use
other_detailto describe renovation scope - Update area if renovations change square footage
Ownership Transfer
- Update
previous_owner_idwith currentowner_id - Set new
owner_id - Update
acquisition_priceif applicable
Multi-Building Management
- Use
buildingfield to identify specific buildings - Use
floorfor vertical organization - Use
lot_numberfor legal subdivision tracking
Business Rules
- Area Validation: Area must be greater than 0
- Place Association: Estates must belong to exactly one place
- Owner Tracking: Previous owner is automatically set during ownership transfers
- Type Reference: Estate type must exist in the types system
- Nested Updates: Updating estate also updates the
updated_attimestamp - Deletion Constraints: An estate referenced by any lease (of any status, including
TERMINATED) cannot be deleted (409 Conflict): archive it instead - Archiving: Only
VACANTestates can be archived; archived estates leave theestatequota and the default listings but keep all history - Quota: The plan
estatequota counts only active (non-archived) estates; unarchiving is blocked (403 PLAN_LIMIT_REACHED) when it would exceed the limit
Integration Notes
- Estate Types: Reference to the Types API for estate categorization
- Owners: Integration with owner management system
- Rooms: Estates can contain multiple rooms with detailed layouts
- Leases: Estates are the primary unit for lease agreements
- Energy Diagnostics: Required for certain property types and regulations
- Financial Calculations: Tax values used for lease calculations and reporting