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/type/:type endpoint returns all property listings that match a specific property type. No authentication is required. Before the value is validated, the server automatically capitalizes the first letter of the supplied type parameter using a capitalize() utility — meaning casa, CASA, and Casa all resolve to Casa. If the type does not match one of the four permitted values after capitalization, the server returns a 422 validation error. If no properties of that type exist in the database, a 500 error is returned.

Endpoint

GET /api/properties/type/:type

Authentication

None required. This is a public endpoint.

Path Parameters

type
string
required
The category of property to filter by. Must be one of the following values (case-insensitive, automatically capitalized by the server):
  • Casa — Residential house
  • Apartamento — Apartment or condominium unit
  • Terreno — Land or undeveloped plot
  • Comercial — Commercial property

Input Normalization

The server passes the raw :type path segment through a capitalize() utility before schema validation. This means inputs such as casa, CASA, or cAsA are all normalized to Casa before being checked against the allowed enum values. You may send the value in any casing.

Response

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

Response Fields

properties
array
required
Array of property objects that match the requested type. Each element contains the full property record.

Error Responses

StatusBodyDescription
422{ "error": "<validation message>" }The supplied type is not one of the four valid enum values after capitalization. The error message is generated by the Zod schema and indicates the invalid value and the permitted options.
500{ "error": "No hay propiedades de este tipo" }The type is valid but no properties of that type exist in the database.

Examples

Request — Filter by Casa

curl --request GET \
  --url https://your-api-domain.com/api/properties/type/Casa

Request — Filter by Apartamento

curl --request GET \
  --url https://your-api-domain.com/api/properties/type/Apartamento

Request — Filter by Terreno

curl --request GET \
  --url https://your-api-domain.com/api/properties/type/Terreno

Request — Filter by Comercial

curl --request GET \
  --url https://your-api-domain.com/api/properties/type/Comercial

Success Response

{
  "properties": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "title": "Casa colonial en Los Palos Grandes",
      "description": "Amplia casa colonial con jardín y piscina.",
      "status": "Venta",
      "property_type": "Casa",
      "address": "Calle Los Mangos, Qta. El Bosque",
      "city": "Caracas",
      "state": "Distrito Capital",
      "price": 220000,
      "bedrooms": 4,
      "bathrooms": 3,
      "square_feet": 2400,
      "parking_lots": 2,
      "img_url": "https://example.com/images/casa-colonial.jpg",
      "user_id": "f7e6d5c4-b3a2-1098-fedc-ba9876543210"
    }
  ]
}

Validation Error Response

{
  "error": "El tipo de propiedad 'Chalet' no es válido. Los tipos permitidos son: Casa, Apartamento, Terreno, Comercial."
}

Not Found Error Response

{
  "error": "No hay propiedades de este tipo"
}

Build docs developers (and LLMs) love