Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nelrondon/backend-proyecto-estructuras/llms.txt

Use this file to discover all available pages before exploring further.

The GET /api/properties/status/:status endpoint returns all property listings that match a specific availability status. No authentication is required. Before the value is validated, the server automatically capitalizes the first letter of the :status parameter using a capitalize() utility, so inputs like venta, VENTA, and Venta all resolve to the same value. If the status is not one of the three valid options after normalization, the server returns a 422 validation error. If no properties with that status exist, a 500 error is returned.
The response envelope key for this endpoint is propierties (note the spelling), which matches the variable name used in the controller source code. Clients should read the array from response.propierties.

Endpoint

GET /api/properties/status/:status

Authentication

None required. This is a public endpoint.

Path Parameters

status
string
required
The availability status to filter by. Must be one of the following values (case-insensitive, automatically capitalized by the server):
  • Venta — Properties listed for sale
  • Alquiler — Properties listed for rent
  • Ambas — Properties available for both sale and rent

Status Values Explained

ValueMeaning
VentaThe property is listed for sale.
AlquilerThe property is listed for rent.
AmbasThe property is available for both sale and rent simultaneously.

Input Normalization

The raw :status path segment is passed through a capitalize() utility before schema validation. This means inputs such as venta, VENTA, or vEnTa are all normalized to Venta before being checked against the allowed enum values.

Response

On success, the endpoint returns a JSON object with a propierties key containing an array of matching property records.

Response Fields

propierties
array
required
Array of property objects whose status column matches the requested value. Each element contains the full property record.

Error Responses

StatusBodyDescription
422{ "error": "<validation message>" }The supplied status is not one of the three valid enum values after capitalization. The Zod schema provides a message indicating the invalid value and the permitted options.
500{ "error": "No existen propiedades con este Estado" }The status is valid but no properties with that status exist in the database.

Examples

Request — Filter by Venta (For Sale)

curl --request GET \
  --url https://your-api-domain.com/api/properties/status/Venta

Request — Filter by Alquiler (For Rent)

curl --request GET \
  --url https://your-api-domain.com/api/properties/status/Alquiler

Success Response

{
  "propierties": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "title": "Local comercial en Chacao",
      "description": "Local de planta baja ideal para oficina o consultorio.",
      "status": "Alquiler",
      "property_type": "Comercial",
      "address": "Av. Francisco de Miranda, Centro Comercial Chacao",
      "city": "Caracas",
      "state": "Distrito Capital",
      "price": 1200,
      "bedrooms": 0,
      "bathrooms": 1,
      "square_feet": 420,
      "parking_lots": 1,
      "img_url": "https://example.com/images/local-chacao.jpg",
      "user_id": "f7e6d5c4-b3a2-1098-fedc-ba9876543210"
    }
  ]
}

Validation Error Response

{
  "error": "El estado de propiedad 'Disponible' no es válido. Los estados permitidos son: Venta, Alquiler, Ambas."
}

Not Found Error Response

{
  "error": "No existen propiedades con este Estado"
}

Build docs developers (and LLMs) love