Skip to main content
PUT
/
api
/
properties
/
:id
Update Property
curl --request PUT \
  --url https://api.example.com/api/properties/:id \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "propertyTypeId": 123,
  "propertySubtypeId": 123,
  "operationTypeId": 123,
  "statusId": 123,
  "status": "<string>",
  "currencyId": 123,
  "price": 123,
  "originalPrice": 123,
  "expenses": 123,
  "surfaceCoveredM2": 123,
  "surfaceUncoveredM2": 123,
  "lotSize": 123,
  "rooms": 123,
  "bedrooms": 123,
  "bathrooms": 123,
  "yearBuilt": 123,
  "conditionId": 123,
  "condition": "<string>",
  "floor": 123,
  "hasBalcony": {},
  "hasTerrace": {},
  "hasLaundry": {},
  "hasGarden": {},
  "petsAllowed": {},
  "garageSpaces": 123,
  "youtubeVideoUrl": "<string>",
  "oportunidad": {},
  "creditoHipotecario": {},
  "aptoProfesional": {},
  "aceptaPermuta": {},
  "amoblado": {},
  "duenioDirecto": {},
  "features": [
    "<string>"
  ],
  "contactPhone": "<string>",
  "contactEmail": "<string>",
  "location": {},
  "images": [
    null
  ],
  "imagesToDelete": [
    123
  ],
  "imagesMeta": [
    {
      "id": 123,
      "url": "<string>",
      "orderIndex": 123,
      "isMain": true
    }
  ],
  "existingImageRotations": {},
  "newImageRotations": [
    123
  ],
  "mainNewImageIndex": 123
}
'
{
  "success": true,
  "message": "<string>",
  "data": {}
}

Overview

Update an existing property’s details, images, and location. Supports partial updates - only provided fields will be modified.

Authentication

Authorization
string
required
Bearer token. Admin role required.

Path Parameters

id
number
required
The property ID to update.

Request Body

Accepts multipart/form-data for image uploads. All fields are optional - only provided fields will be updated.

Property Details

title
string
Property title.
description
string
Property description.
propertyTypeId
number
Property type ID.
propertySubtypeId
number
Property subtype ID.
operationTypeId
number
Operation type ID.
statusId
number
Status ID.
status
string
Status slug or name (alternative to statusId).
currencyId
number
Currency ID.
price
number
Property price.
originalPrice
number
Original price.
expenses
number
Monthly expenses.
surfaceCoveredM2
number
Covered surface in m².
surfaceUncoveredM2
number
Uncovered surface in m².
lotSize
number
Lot size in m².
rooms
number
Number of rooms.
bedrooms
number
Number of bedrooms.
bathrooms
number
Number of bathrooms.
yearBuilt
number
Year built.
conditionId
number
Condition ID.
condition
string
Condition name.
floor
number
Floor number.

Features

hasBalcony
boolean | string
Has balcony.
hasTerrace
boolean | string
Has terrace.
hasLaundry
boolean | string
Has laundry.
hasGarden
boolean | string
Has garden.
petsAllowed
boolean | string
Pets allowed.
garageSpaces
number
Garage spaces.
youtubeVideoUrl
string
YouTube URL.
oportunidad
boolean | string
Opportunity listing.
creditoHipotecario
boolean | string
Mortgage credit.
aptoProfesional
boolean | string
Professional use.
aceptaPermuta
boolean | string
Property exchange.
amoblado
boolean | string
Furnished.
duenioDirecto
boolean | string
Direct owner.
features
string[]
Custom features (replaces all existing features).

Contact

contactPhone
string
Contact phone.
contactEmail
string
Contact email.

Location

location
object
Location object (partial updates supported).

Image Management

images
File[]
New image files to upload. Appended to existing images.
imagesToDelete
number[]
Array of image IDs to delete (JSON array as string).
imagesMeta
array
Update image metadata (order, main image). JSON array as string.
id
number
required
Image ID.
url
string
required
Image URL.
orderIndex
number
required
Display order.
isMain
boolean
required
Main image flag.
existingImageRotations
object
Rotate existing images. Object mapping image ID to rotation step (0-3). JSON object as string.
newImageRotations
number[]
Rotation for new uploads (0-3 per image).
mainNewImageIndex
number
Index of main image among new uploads.

Response

success
boolean
Success indicator.
message
string
Success message.
data
object
Updated property object (same structure as GET endpoint).

Example Request

curl -X PUT "https://api.example.com/api/properties/123" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -F "title=Updated Title" \
  -F "price=280000" \
  -F "bedrooms=3" \
  -F "status=activo" \
  -F 'imagesToDelete=[456]' \
  -F "[email protected]" \
  -F 'imagesMeta=[{"id":457,"url":"https://...","orderIndex":0,"isMain":true}]'

Example Response

{
  "success": true,
  "message": "Property updated successfully",
  "data": {
    "id": "123",
    "title": "Updated Title",
    "price": 280000,
    "bedrooms": 3,
    "status": "activo"
    // ... full property object
  }
}

Error Responses

Not Found (404)

{
  "success": false,
  "message": "Property not found"
}

Validation Error (400)

{
  "success": false,
  "message": "Validation error",
  "errors": [...]
}

Unauthorized (401)

{
  "success": false,
  "message": "Unauthorized"
}

Notes

  • Only provided fields are updated (partial update)
  • Images are managed separately:
    • imagesToDelete: removes existing images and their storage files
    • images: uploads new images (appended to existing)
    • imagesMeta: updates order and main image flag
    • existingImageRotations: physically rotates images in storage
  • Image rotation is applied physically and saved with 0° rotation in DB
  • When images are deleted, both large and thumbnail variants are removed from storage
  • URL slug is generated if missing during update
  • updatedAt timestamp is automatically set

Build docs developers (and LLMs) love