> ## Documentation Index
> Fetch the complete documentation index at: https://docs.isprop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Actualizar unidad existente

> Actualiza los campos enviados en la peticion. Los campos no enviados permanecen sin cambios.

Acepta los mismos campos de `address` y `attributes` que el endpoint de creacion.
- `address`: crea o actualiza la direccion de la unidad.
- `attributes`: sincroniza los atributos EAV (merge, no reemplaza los no enviados).



## OpenAPI

````yaml /api/openapi.json put /units/{unit}
openapi: 3.1.0
info:
  title: Isprop API
  version: 1.0.0
  description: API para gestión de unidades inmobiliarias y leads de Isprop
servers:
  - url: https://{tenantDomain}/api/v1
    description: Dominio del tenant
    variables:
      tenantDomain:
        default: tenant.example.com
        description: Dominio asignado al tenant, sin protocolo ni ruta.
security:
  - http: []
tags:
  - name: Unit
  - name: Project
  - name: Product
  - name: Typology
  - name: Lead
  - name: Lead Channel
  - name: Attribute
paths:
  /units/{unit}:
    put:
      tags:
        - Unit
      summary: Actualizar unidad existente
      description: >-
        Actualiza los campos enviados en la peticion. Los campos no enviados
        permanecen sin cambios.


        Acepta los mismos campos de `address` y `attributes` que el endpoint de
        creacion.

        - `address`: crea o actualiza la direccion de la unidad.

        - `attributes`: sincroniza los atributos EAV (merge, no reemplaza los no
        enviados).
      operationId: updateUnit
      parameters:
        - name: unit
          in: path
          required: true
          description: The unit UUID
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUnitRequest'
      responses:
        '200':
          description: '`Unit`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Unit'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateUnitRequest:
      type: object
      description: >-
        Request para actualizar una unidad existente


        Valida los datos para actualizar una unidad inmobiliaria. Todos los
        campos son opcionales

        y solo se actualizarán los campos enviados en la petición.
      properties:
        project_id:
          type:
            - string
            - 'null'
          format: uuid
        product_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type:
            - string
            - 'null'
          enum:
            - disponible
            - pisado
            - cotizado
            - reservado
            - revision
            - vendido
            - no_disponible
        listing_type:
          type:
            - string
            - 'null'
          enum:
            - venta
            - alquiler
            - alquiler_temporal
            - permuta
        sku:
          type: string
          maxLength: 50
        name:
          type:
            - string
            - 'null'
          maxLength: 100
        stage:
          type:
            - string
            - 'null'
          maxLength: 100
        sector:
          type:
            - string
            - 'null'
          maxLength: 50
        unit:
          type:
            - string
            - 'null'
          maxLength: 50
        currency_type:
          type: string
          enum:
            - ARS
            - USD
            - EUR
        price:
          type: number
          minimum: 1
        store_active:
          type: boolean
        store_link:
          type:
            - string
            - 'null'
          format: uri
          maxLength: 500
        possession_date:
          type:
            - string
            - 'null'
          format: date-time
        possession_type:
          type:
            - string
            - 'null'
          enum:
            - pozo
            - inmediata
            - en_ejecucion
        attributes:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
        address:
          type: object
          description: ── Address (optional nested object) ────────────────────────
          properties:
            country:
              type:
                - string
                - 'null'
              enum:
                - AR
                - BO
                - BR
                - CO
                - CL
                - EC
                - ES
                - US
                - MX
                - PY
                - PE
                - UY
                - VE
              minLength: 2
              maxLength: 2
            state:
              type:
                - string
                - 'null'
              maxLength: 100
            city:
              type:
                - string
                - 'null'
              maxLength: 100
            neighborhood:
              type:
                - string
                - 'null'
              maxLength: 100
            district:
              type:
                - string
                - 'null'
              maxLength: 100
            postal_code:
              type:
                - string
                - 'null'
              maxLength: 20
            address_line_1:
              type:
                - string
                - 'null'
              maxLength: 255
            address_line_2:
              type:
                - string
                - 'null'
              maxLength: 255
            latitude:
              type:
                - number
                - 'null'
              minimum: -90
              maximum: 90
            longitude:
              type:
                - number
                - 'null'
              minimum: -180
              maximum: 180
      title: UpdateUnitRequest
    Unit:
      type: object
      properties:
        id:
          type: string
        sku:
          type: string
        listing_type:
          anyOf:
            - type: 'null'
            - type: string
              enum:
                - venta
                - alquiler
                - alquiler_temporal
                - permuta
        status:
          type: string
          enum:
            - disponible
            - pisado
            - cotizado
            - reservado
            - revision
            - vendido
            - no_disponible
        name:
          type: string
        stage:
          type: string
        sector:
          type: string
        unit:
          type: string
        price:
          type: string
        formatted_price:
          type: string
        currency_type:
          type: string
        currency_label:
          type: string
        total_area:
          type: string
        covered_area:
          type: string
        bedrooms:
          type: string
        bathrooms:
          type: string
        rooms:
          type: string
        store_active:
          type: string
        possession_date:
          type: string
        possession_type:
          type: string
          enum:
            - pozo
            - inmediata
            - en_ejecucion
        financial:
          type: object
          description: Condiciones comerciales
          properties:
            integration_percentage:
              type: string
            integration_discount:
              type: string
            installments:
              type: string
            currency_index_type:
              type: string
          required:
            - integration_percentage
            - integration_discount
            - installments
            - currency_index_type
        published_at:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        media:
          type: object
          properties:
            gallery:
              anyOf:
                - type: array
                  items:
                    type: string
                  minItems: 0
                  maxItems: 0
                  additionalItems: false
                - type: string
          required:
            - gallery
        project:
          $ref: '#/components/schemas/ProjectSummary'
        product:
          $ref: '#/components/schemas/ProductSummary'
        typology:
          anyOf:
            - $ref: '#/components/schemas/Typology'
            - type: 'null'
        address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        attributes:
          type:
            - array
            - 'null'
          description: >-
            EAV attribute values as a flat `{ key: typed_value }` map. Includes

            denormalized fields (total_area, covered_area, bedrooms, bathrooms,
            rooms)

            so the map is a complete, self-contained snapshot of the unit.
            Top-level

            fields remain available for sorting/filtering.

            Schema metadata (label, icon, data_type, options) lives in GET
            /v1/attributes.
          items: {}
        badges:
          type: string
        attribute_categories:
          type:
            - string
            - 'null'
          description: >-
            EAV attributes grouped by category, with label/icon/sort_order for
            UI spec sheets.
      required:
        - id
        - sku
        - listing_type
        - status
        - name
        - stage
        - sector
        - unit
        - price
        - formatted_price
        - currency_type
        - currency_label
        - total_area
        - covered_area
        - bedrooms
        - bathrooms
        - rooms
        - store_active
        - possession_date
        - possession_type
        - financial
        - published_at
        - created_at
        - updated_at
        - media
        - attributes
        - badges
        - attribute_categories
      title: Unit
    ProjectSummary:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        description:
          type: string
        tagline:
          type: string
        store_active:
          type: string
        logos:
          type:
            - array
            - 'null'
          items: {}
        address:
          anyOf:
            - $ref: '#/components/schemas/AddressSummary'
            - type: 'null'
        product_types:
          type:
            - array
            - 'null'
          description: >-
            Tipos de producto distintos entre los products del proyecto (ej:
            ["lotes"] o ["departamentos","cocheras","oficinas"])
          items: {}
        lots_map:
          type:
            - array
            - 'null'
          description: >-
            Config del overlay de tiles para la vista de mapa de lotes (null si
            el emprendimiento no tiene uno definido).
          items: {}
        has_lots_map:
          type: boolean
          description: >-
            Conveniencia para mostrar el toggle Lista/Mapa sin inspeccionar
            `lots_map`.
        published_at:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - slug
        - name
        - description
        - tagline
        - store_active
        - logos
        - product_types
        - lots_map
        - has_lots_map
        - published_at
        - created_at
        - updated_at
      title: ProjectSummary
    ProductSummary:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        description:
          type: string
        product_type:
          type: string
        product_type_label:
          type: string
        type_labels:
          type: object
          properties:
            sector:
              anyOf:
                - type: string
                - type: string
                  enum:
                    - Sector
            unit:
              anyOf:
                - type: string
                - type: string
                  enum:
                    - Unidad
          required:
            - sector
            - unit
        thumbnail_url:
          type:
            - string
            - 'null'
        store_active:
          type: string
        logos:
          type:
            - array
            - 'null'
          description: >-
            Override: null cuando el producto no tiene logo propio (el front cae
            al del project).
          items: {}
        project:
          $ref: '#/components/schemas/ProjectSummary'
        address:
          anyOf:
            - $ref: '#/components/schemas/AddressSummary'
            - type: 'null'
        published_at:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - slug
        - name
        - description
        - product_type
        - product_type_label
        - type_labels
        - thumbnail_url
        - store_active
        - logos
        - published_at
        - created_at
        - updated_at
      title: ProductSummary
    Typology:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        media:
          type: object
          properties:
            gallery:
              anyOf:
                - type: array
                  items:
                    type: string
                  minItems: 0
                  maxItems: 0
                  additionalItems: false
                - type: string
          required:
            - gallery
        product:
          $ref: '#/components/schemas/ProductSummary'
          description: Relaciones condicionales (summary para evitar nesting circular)
        units_count:
          type: integer
      required:
        - id
        - name
        - description
        - created_at
        - updated_at
        - media
      title: Typology
    Address:
      type: object
      properties:
        country:
          type: string
        state:
          type: string
        city:
          type: string
        neighborhood:
          type: string
        district:
          type: string
        postal_code:
          type: string
        address_line_1:
          type: string
        address_line_2:
          type: string
        phone:
          type: string
        latitude:
          type: string
        longitude:
          type: string
      required:
        - country
        - state
        - city
        - neighborhood
        - district
        - postal_code
        - address_line_1
        - address_line_2
        - phone
        - latitude
        - longitude
      title: Address
    AddressSummary:
      type: object
      properties:
        country:
          type: string
        state:
          type: string
        city:
          type: string
        neighborhood:
          type: string
      required:
        - country
        - state
        - city
        - neighborhood
      title: AddressSummary
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: sanctum

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.