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)
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
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 |
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: Cannot delete estates with active leases or rooms
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