# Update a property

URL: https://api-docs.vestta.io/properties/update

Update a property without exposing its private CRM record.

Only supplied top-level fields change. `pricing` and `characteristics` merge supplied fields; `location` and `area` are complete replacement objects. `features` replaces the list. Only `subtype` can be cleared with `null`. A property must retain a holder: `owner_id` cannot be cleared. To update a legacy property without a holder, supply a valid `owner_id` with the changes.

When changing `type` or `subtype`, the resulting subtype must belong to the resulting type. Send both together when switching to a type with different subtype options; use the [canonical subtype keys](/properties/create). Updates to unrelated fields preserve legacy subtype values.

This endpoint cannot replace image URLs or set publication directly. Use upload sessions and the publication endpoint. Updating a public property's gallery queues marked-image processing before it is made visible again.

If the property is already configured to publish to Idealista in Vestta, an update can queue synchronization with Idealista. A successful response confirms that the property was saved in Vestta. Check the property's **Portales** panel for the result of the synchronization.

### PATCH /v1/properties/{property_id}

Updates supplied fields while preserving private CRM metadata and media. If Idealista publishing is already enabled for the property in Vestta, the update can be queued for synchronization. Requires the `properties:write` scope.

Required scope: `properties:write`

Path parameters:
- `property_id` (integer, required, ≥ 1)

Request body (PropertyUpdateRequest, required, application/json):
- `operations` (array of strings, optional, nullable)
- `type` (PropertyType, optional, nullable)
- `subtype` (PropertySubtype, optional, nullable): Canonical subtype key for the property type: apartamento: apartamento, atico, planta_baja, duplex, estudio; casa: adosado, unifamiliar, multifamiliar, rustica, chalet, villa; local: local_comercial; nave: industrial, warehouse, other; almacenaje: almacen, trastero; oficina: on_high, ground_floor; terreno: rustico, urbano, urbanizable, industrial, terciario, otros; aparcamiento: garaje, parking, amarre; edificio: hotel, edificio, apartahotel. Responses return a Spanish display label instead of this key.
- `title` (string, optional, nullable, 1–300 chars)
- `description` (string, optional, nullable, ≤ 50000 chars)
- `pricing` (PropertyPricing, optional, nullable)
  - `sale` (number, optional, nullable, ≥ 0)
  - `rent` (number, optional, nullable, ≥ 0)
  - `transfer` (number, optional, nullable, ≥ 0)
- `location` (PropertyLocation, optional, nullable)
  - `city` (string, required, 2–150 chars)
  - `province` (string, optional, nullable, ≤ 150 chars)
  - `country` (string, optional, 2–100 chars, default España)
  - `address` (string, required, 2–500 chars)
  - `full_address` (string, required, 5–1000 chars)
  - `postal_code` (string, optional, nullable, ≤ 20 chars)
  - `coordinates` (Coordinates, required)
    - `latitude` (number, required, ≥ -90, ≤ 90)
    - `longitude` (number, required, ≥ -180, ≤ 180)
  - `visibility` (string, optional, default approximate, values: `public` | `approximate` | `hidden`)
- `area` (PropertyArea, optional, nullable)
  - `total` (number, required, ≥ 0)
  - `usable` (number, optional, nullable, ≥ 0)
  - `plot` (number, optional, nullable, ≥ 0)
- `bedrooms` (integer, optional, nullable, ≥ 0, ≤ 1000)
- `bathrooms` (integer, optional, nullable, ≥ 0, ≤ 1000)
- `characteristics` (PropertyCharacteristics, optional, nullable)
  - `translations` (TranslationSpec, optional, nullable): Traducciones de las descripciones
    - `ca` (TranslatedDescription, optional, nullable): Traduccion en catalán de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
    - `en` (TranslatedDescription, optional, nullable): Traduccion en ingles de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
    - `fr` (TranslatedDescription, optional, nullable): Traduccion en francés de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
    - `de` (TranslatedDescription, optional, nullable): Traduccion en alemán de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
    - `pt` (TranslatedDescription, optional, nullable): Traduccion en portuges de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
    - `it` (TranslatedDescription, optional, nullable): Traduccion en italiano de la descripción
      - `title` (string, optional, nullable): Título de la descripción
      - `description` (string, optional, nullable): Descripción
  - `size_built` (number, optional, nullable, ≥ 0): Superficie construida
  - `porch_size` (number, optional, nullable, ≥ 0): Metros cuadrados porche
  - `size_terraces` (number, optional, nullable, ≥ 0): Metros cuadrados terrazas
  - `attic_size` (number, optional, nullable, ≥ 0): Metros cuadrados ático
  - `storage_dimensions` (number, optional, nullable): Dimensiones del trastero
  - `doble_bedrooms` (integer, optional, nullable, ≥ 0): Número de habitaciones dobles
  - `suite_bathrooms` (integer, optional, nullable, ≥ 0): Número de baños en suite
  - `num_terraces` (integer, optional, nullable, ≥ 0): Número de terrazas
  - `conservation` (string, optional, nullable): Estado de conservación
  - `floor` (string, optional, nullable): Planta canónica para portales
  - `house_floors` (integer, optional, nullable, ≥ 1): Número de plantas de una casa
  - `elevator` (boolean, optional, nullable): Tiene ascensor (0/1 o Sí/No)
  - `views` (string, optional, nullable): Vistas de la propiedad
  - `orientation` (string, optional, nullable): Orientación (norte, sur, este, oeste)
  - `energy_certificate` (string, optional, nullable): Certificado energético A-G
  - `emissions` (string, optional, nullable): Emisiones A-G
  - `energy_consumption_value` (number, optional, nullable, ≥ 1, ≤ 999): Consumo (kWh/m² año)
  - `emissions_value` (number, optional, nullable, ≥ 1, ≤ 999): Emisiones (kg CO₂/m² año)
  - `height` (number, optional, nullable): Altura del local
  - `facade_meters` (number, optional, nullable): Metros de fachada
  - `meters_showcase` (number, optional, nullable): Metros de escaparate
  - `entrace_type` (string, optional, nullable): Tipo de entrada de la oficina
  - `position` (string, optional, nullable): 1ª/2ª Linea del mar
  - `offices` (integer, optional, nullable, ≥ 0): Número de despachos
  - `meeting_rooms` (integer, optional, nullable, ≥ 0): Número de salas de reuniones
  - `camino` (string, optional, nullable): Tipo de suelo
  - `terrain_extension` (string, optional, nullable): Tamaño (Grande/Pequeño)
  - `topography` (string, optional, nullable): Topografía del terreno
  - `num_seats` (integer, optional, nullable, ≥ 0): Número de plazas
  - `dimensions` (string, optional, nullable): Dimensiones del aparcamiento
  - `turistic_license` (string, optional, nullable): Licencia turística
  - `construction_year` (integer, optional, nullable): Año de construcción
  - `exposure` (string, optional, nullable): Interior o Exterior
  - `style` (string, optional, nullable): Conservación
  - `num_viviendas` (integer, optional, nullable): Número de viviendas
  - `num_locales` (integer, optional, nullable): Número de locales
  - `num_ascensores` (integer, optional, nullable): Número de ascensores
  - `num_parkings` (integer, optional, nullable, ≥ 0): Número de parkings incluidos
  - `num_floors` (integer, optional, nullable): Número de plantas
  - `luxury_property` (boolean, optional, nullable): Propiedad de lujo
  - `holiday_renting` (boolean, optional, nullable): Alquiler vacacional
  - `purchase_option_rental` (boolean, optional, nullable): Alquiler con opción a compra
  - `activities` (ActivitiesSpec, optional, nullable): Actividades permitidas
    - `predefined` (array of strings, optional): Actividades predefinidas
    - `custom` (array of strings, optional): Actividades personalizadas
  - `num_entrances` (NumEntrancesSpec, optional, nullable): Número de entradas
    - `total` (integer, optional, ≥ 0, default 0): Total de entradas
    - `peaton_entrances` (integer, optional, ≥ 0, default 0): Entradas de peatones
    - `moto_entrances` (integer, optional, ≥ 0, default 0): Entradas de motos
    - `van_entrances` (integer, optional, ≥ 0, default 0): Entradas de furgoneta
    - `car_entrances` (integer, optional, ≥ 0, default 0): Entradas de coche
  - `floor_breakdown` (FloorBreakdownSpec, optional, nullable): Desglose de plantas
    - `base_floor` (integer, optional, default 0): Metros ² de la planta baja
    - `first_floor` (integer, optional, default 0): Metros ² de la primera planta
    - `second_floor` (integer, optional, default 0): Metros ² de la segunda planta
- `features` (array of objects, optional, nullable)
  - `key` (string, required, 1–100 chars)
  - `label` (string, required, 1–200 chars)
  - `value` (string | boolean | integer | number, required)
  - `isextra` (boolean, optional, default false)
- `owner_id` (integer, optional, nullable, ≥ 1)
- `is_featured` (boolean, optional, nullable)
- `status` (string, optional, nullable, values: `disponible` | `reservada` | `retirado` | `vendida` | `alquilada`)

Response 200: Successful response.
- `status` (string, optional, default ok, values: `ok`)
- `id` (integer, required)

```json
{
  "status": "ok",
  "id": 1355
}
```

Response 401: The API key is missing, malformed, unknown, revoked or expired.

Response 403: The API key lacks the required scope, or the business plan does not include API access.

Response 404: The resource does not exist in this business.

Response 409: Duplicate contact or idempotency key reused with a different payload.

Response 422: A path parameter, query parameter or body field is invalid.

Response 429: The API key reached its request limit. Wait for the number of seconds in `Retry-After` before retrying.

Response 500: Unexpected server error while processing the request.

### Example requests

#### cURL

```bash
curl -X PATCH "https://api.vestta.io/v1/properties/1" \
  -H "X-Api-Key: $VESTTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Updated apartment title",
  "pricing": {
    "sale": 340000
  }
}'
```

#### JavaScript

```javascript
const response = await fetch('https://api.vestta.io/v1/properties/1', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': process.env.VESTTA_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "title": "Updated apartment title",
    "pricing": {
      "sale": 340000
    }
  }),
})

const data = await response.json()
```

#### Python

```python
import os

import requests

response = requests.patch(
    "https://api.vestta.io/v1/properties/1",
    headers={"X-Api-Key": os.environ["VESTTA_API_KEY"]},
    json={
        "title": "Updated apartment title",
        "pricing": {
            "sale": 340000,
        },
    },
)
response.raise_for_status()
data = response.json()
```
