Skip to main content

PATCH /api/propiedades/

Update an existing property’s information. This endpoint supports partial updates - you only need to include the fields you want to change. This endpoint requires admin authentication using HTTP Basic Auth.
This endpoint requires authentication. Include the Authorization header with Basic Auth credentials.

Request

id
string
required
The unique 6-character property identifier (e.g., “ZN1001”)
pais
string
Country where the property is located (e.g., “Argentina”)
ciudad
string
City where the property is located (e.g., “Tigre”)
direccion
string
Street address of the property (e.g., “Av. Cazón 123”)
ambientes
number
Number of rooms in the property
metros_cuadrados
number
Property size in square meters
precio
number
Property price in local currency
tipo_contratacion
enum
Type of contract. Must be one of: Alquiler (Rent) or Venta (Sale)
estado
enum
Current status of the property. Must be one of: Disponible (Available), Reservado (Reserved), Alquilado (Rented), Vendido (Sold)
descripcion
string
Optional description or additional details about the property

Example Request

curl -X PATCH https://idforideas-1.jamrdev.com.ar/api/propiedades/ZN1001 \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic <base64-credentials>" \
  -d '{
    "precio": 135000,
    "estado": "Reservado"
  }'

Response

success
boolean
required
Indicates whether the operation was successful
message
string
required
Human-readable message describing the result
error
string
Error message describing what went wrong (returned on failure)

Example Response

Success (200)
{
  "success": true,
  "message": "Propiedad actualizada"
}
Not Found (404)
{
  "success": false,
  "error": "Propiedad no encontrada"
}
Validation Error (400)
{
  "success": false,
  "error": "Invalid estado value"
}
Unauthorized (401)
{
  "error": "Unauthorized"
}

Status Codes

200
Success
Property updated successfully
400
Bad Request
Invalid data or validation error in request body
401
Unauthorized
Authentication required or credentials invalid
404
Not Found
Property with the specified ID does not exist

Notes

  • This is a partial update endpoint - you only need to include fields you want to change
  • Fields not included in the request will remain unchanged
  • The codigo_id field cannot be modified through this endpoint. If you include a codigo_id in the request body that differs from the URL parameter, the request will fail with a 400 error
  • All provided fields must pass validation according to the property schema
  • Use the SQL COALESCE function to preserve existing values for fields not included in the update

Build docs developers (and LLMs) love