Overview
Admin endpoints for comprehensive property management, including viewing all properties (regardless of status) and updating property statuses.
All endpoints on this page require admin role authentication via the requireAdmin middleware.
List All Properties
Retrieve a paginated list of all properties with full details, including inactive properties. Unlike the public properties endpoint, this shows properties with any status.
Query Parameters
Page number for pagination
Number of properties per page
Response
Indicates if the request was successful
Array of property objects with full details Full property description
Type of property (e.g., “Casa”, “Departamento”)
Operation type (e.g., “Venta”, “Alquiler”)
Name of the property owner/user
ISO 8601 timestamp of creation
Number of times the property has been viewed
Pagination metadata Total number of properties
Success Response
Error Response
{
"success" : true ,
"data" : [
{
"id" : "123" ,
"title" : "Casa moderna en Palermo" ,
"description" : "Hermosa casa con jardín..." ,
"price" : 250000 ,
"propertyType" : "Casa" ,
"listingType" : "Venta" ,
"status" : "Activo" ,
"address" : {
"street" : "Av. Santa Fe 1234" ,
"city" : "Buenos Aires" ,
"state" : "CABA" ,
"zipCode" : "1425" ,
"country" : "Argentina"
},
"owner" : "Juan Pérez" ,
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"viewsCount" : 45 ,
"images" : [
"https://example.com/image1.jpg" ,
"https://example.com/image2.jpg"
],
"imagesMeta" : [
{
"id" : 1 ,
"url" : "https://example.com/image1.jpg" ,
"orderIndex" : 0 ,
"isMain" : true
},
{
"id" : 2 ,
"url" : "https://example.com/image2.jpg" ,
"orderIndex" : 1 ,
"isMain" : false
}
]
}
],
"pagination" : {
"currentPage" : 1 ,
"totalPages" : 15 ,
"totalItems" : 150 ,
"limit" : 10
}
}
Update Property Status
Update the status of a property. This endpoint supports multiple formats for specifying the status.
Path Parameters
Request Body
You can provide the status in any of the following formats:
Alternative field name for status ID
Status name or slug. The system will look it up automatically.
The endpoint will automatically resolve the status from any of these fields. If status is provided as a name/slug, it will be looked up in the database.
Response
Indicates if the status was updated successfully
Success Response
Error - Invalid Input
Error - Not Found
Error - Server Error
{
"success" : true ,
"message" : "Property status updated successfully"
}
Request Examples
curl -X PUT https://api.example.com/api/admin/properties/123/status \
-H "Content-Type: application/json" \
-H "Cookie: session=..." \
-d '{
"statusId": 2
}'
curl -X PUT https://api.example.com/api/admin/properties/123/status \
-H "Content-Type: application/json" \
-H "Cookie: session=..." \
-d '{
"status": "pendiente"
}'
const response = await fetch ( '/api/admin/properties/123/status' , {
method: 'PUT' ,
headers: {
'Content-Type' : 'application/json' ,
},
credentials: 'include' ,
body: JSON . stringify ({
statusId: 2
})
});
const data = await response . json ();
Implementation Details
Updates the statusId and updatedAt fields
Validates property exists before updating
Supports multiple input formats for flexibility
Status lookup is case-insensitive when using status name/slug
Returns 400 for invalid input
Returns 404 if property not found
Returns 500 for server errors