Get All Operation Types
GET /api/metadata/operation-types
Retrieves all available operation types (sale, rent, etc.) that can be associated with properties.
Response
Indicates if the request was successful
Array of operation type objectsShow Operation Type Object
Unique identifier for the operation type
Display name of the operation type
{
"success": true,
"data": [
{
"id": 1,
"name": "Venta",
"slug": "venta"
},
{
"id": 2,
"name": "Alquiler",
"slug": "alquiler"
},
{
"id": 3,
"name": "Alquiler temporal",
"slug": "alquiler-temporal"
},
{
"id": 4,
"name": "Permuta",
"slug": "permuta"
}
]
}
Operation Type Reference
Venta
Sale - Property is available for purchase
Alquiler
Rent - Property is available for long-term rental
Alquiler temporal
Temporary Rent - Property is available for short-term or seasonal rental
Permuta
Exchange - Property is available for exchange/trade
Usage Example
Use operation types when creating or filtering properties:
const operationTypes = await fetch('/api/metadata/operation-types')
.then(res => res.json());
// Use in property creation
const newProperty = {
title: "Hermoso departamento en Palermo",
operation_type_id: 2, // Alquiler
// ... other fields
};