Skip to main content

Overview

The Properties API provides comprehensive endpoints for managing real estate listings. All property operations require authentication except for listing and retrieving individual properties. Base Path: /api/properties

List Properties

const response = await api.properties.list({
  query: "departamento",
  propertyType: ["casa", "departamento"],
  listingType: ["venta"],
  minPrice: 50000,
  maxPrice: 200000,
  bedrooms: 2,
  bathrooms: 1,
  location: "Buenos Aires",
  page: 1,
  limit: 10
});
Retrieve a paginated list of properties with optional filtering.

Query Parameters

query
string
Search text to match in property title or description
propertyType
string[]
Filter by property types (casa, departamento, ph, terreno, local, galpon, oficina, campo, deposito, bodega, consultorio, fondo-comercio, hotel, cochera)
listingType
string[]
Filter by operation types (venta, alquiler, alquiler-temporal, permuta)
status
string[]
Filter by property status (activo, pendiente, vendido, alquilado, pausado)
minPrice
number
Minimum price filter
maxPrice
number
Maximum price filter
bedrooms
number
Minimum number of bedrooms
bathrooms
number
Minimum number of bathrooms
location
string
Location search (city, province, neighborhood)
page
number
default:"1"
Page number for pagination
limit
number
default:"10"
Number of items per page

Response

success
boolean
required
Indicates if the request was successful
data
Property[]
required
Array of property objects
pagination
object
required
Pagination metadata

Usage Example

From src/pages/ListingsPage.tsx:112:
const response = await api.properties.list(filtersToSend);
setProperties(response.data);
setTotalPages(response.pagination.totalPages);

Get Property by ID

const response = await api.properties.get("123");
Retrieve a single property by its numeric ID.

Path Parameters

id
string
required
The unique property ID

Response

success
boolean
required
Indicates if the request was successful
data
Property
required
Complete property object with all fields, images, location, and metadata

Usage Example

From src/routes/propiedades.$propertyId.tsx:24:
const response = await api.properties.get(propertyId);
return response.data;

Get Property by Slug

const response = await api.properties.getBySlug("casa-3-dormitorios-palermo");
Retrieve a single property by its URL-friendly slug.

Path Parameters

slug
string
required
The URL-friendly property slug

Response

success
boolean
required
Indicates if the request was successful
data
Property
required
Complete property object

Usage Example

From src/routes/listings/p/$slug.tsx:23:
const response = await api.properties.getBySlug(slug);
return response.data;

Create Property

const formData = new FormData();
formData.append("title", "Casa en Palermo");
formData.append("description", "Hermosa casa con jardín");
formData.append("price", "250000");
formData.append("propertyTypeId", "1");
formData.append("operationTypeId", "1");
formData.append("bedrooms", "3");
formData.append("bathrooms", "2");
formData.append("images", imageFile);

const response = await api.properties.create(formData);
Create a new property listing. Requires admin authentication.

Request Body

Multipart form data with the following fields:
title
string
required
Property title (max 255 characters)
description
string
required
Detailed property description
price
number
required
Property price
propertyTypeId
number
required
Property type ID (from metadata)
operationTypeId
number
required
Operation type ID (from metadata)
bedrooms
number
required
Number of bedrooms
bathrooms
number
required
Number of bathrooms
surfaceCoveredM2
number
Covered surface area in m²
images
File[]
Property images (multiple files supported)
city
string
required
City name
province
string
required
Province/state name
street
string
Street name
latitude
number
Latitude coordinate
longitude
number
Longitude coordinate
features
string
Comma-separated feature IDs
tags
string
Comma-separated tag IDs

Response

success
boolean
required
Indicates if the property was created successfully
data
object
required

Usage Example

From src/pages/PropertyFormPage.tsx:1154:
await api.properties.create(formData);
toast.success("Propiedad creada exitosamente");

Update Property

const formData = new FormData();
formData.append("title", "Casa Renovada en Palermo");
formData.append("price", "280000");

const response = await api.properties.update("123", formData);
Update an existing property. Requires admin authentication.

Path Parameters

id
string
required
The property ID to update

Request Body

Multipart form data with fields to update (same structure as create endpoint, all fields optional).

Response

success
boolean
required
Indicates if the update was successful
data
Property
required
The updated property object

Usage Example

From src/pages/PropertyFormPage.tsx:1141:
const response = await api.properties.update(propertyId, formData);
toast.success("Propiedad actualizada exitosamente");

Delete Property

const response = await api.properties.delete("123");
Permanently delete a property. Requires admin authentication.

Path Parameters

id
string
required
The property ID to delete

Response

success
boolean
required
Indicates if the deletion was successful
message
string
Confirmation message

Usage Example

From src/pages/AdminPage.tsx:113:
await api.properties.delete(deleteModal.propertyId);
toast.success("Propiedad eliminada");

Add to Favorites

const response = await api.properties.addToFavorites("123");
Add a property to the authenticated user’s favorites list.

Path Parameters

id
string
required
The property ID to favorite

Response

success
boolean
required
Indicates if the property was added to favorites
message
string
Success message

Usage Example

From src/contexts/AuthContext.tsx:336:
await api.properties.addToFavorites(propertyId);
setFavoriteIds((prev) => [...prev, propertyId]);

Remove from Favorites

const response = await api.properties.removeFromFavorites("123");
Remove a property from the authenticated user’s favorites list.

Path Parameters

id
string
required
The property ID to unfavorite

Response

success
boolean
required
Indicates if the property was removed from favorites
message
string
Success message

Usage Example

From src/contexts/AuthContext.tsx:349:
await api.properties.removeFromFavorites(propertyId);
setFavoriteIds((prev) => prev.filter((id) => id !== propertyId));

Error Responses

All endpoints may return the following error responses:
error
object

Common Status Codes

  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (authentication required)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Not Found (property doesn’t exist)
  • 500 - Internal Server Error

Build docs developers (and LLMs) love