# MigrateThingDefinitionRequest

Type: MigrateThingDefinitionRequest

JSON payload to migrate the definition of a Thing.

Schema: [MigrateThingDefinitionRequest](https://sourcey-ditto.pages.dev/http-api-doc/models/migratethingdefinitionrequest.md)

- `thingDefinitionUrl` (required)
  Type: string, uri
  
  The URL of the new Thing definition to be applied.
  
  Example:
  
  ```json
  "https://models.example.com/thing-definition-1.0.0.tm.jsonld"
  ```

- `migrationPayload` (optional)
  Type: object
  
  Optional migration payload with updates to attributes and features.
  String values may contain {{ thing-json:<json-pointer> }} placeholders to reference
  existing Thing data (e.g. attributes/location, features/sensor/properties/temp).
  Resolved values keep their JSON type; missing paths cause the request to fail.
  
  
  - `attributes` (optional)
    Type: object
    
    Attributes to be updated in the thing.
    
    Example:
    
    ```json
    {
      "manufacturer": "New Corp",
      "location": "Berlin, main floor"
    }
    ```
    
    Additional properties: true
  
  - `features` (optional)
    Type: object
    
    Features to be updated in the thing.
    
    Example:
    
    ```json
    {
      "thermostat": {
        "properties": {
          "status": {
            "temperature": {
              "value": 23.5,
              "unit": "DEGREE_CELSIUS"
            }
          }
        }
      }
    }
    ```
    
    Additional properties: 
      Type: object
      
      - `properties` (optional)
        Type: object
        
        Additional properties: true

- `patchConditions` (optional)
  Type: object
  
  Optional conditions to apply the migration only if the existing thing matches the specified values.
  
  Example:
  
  ```json
  {
    "thing:/features/thermostat": "not(exists(/features/thermostat))"
  }
  ```
  
  Additional properties: 
    Type: string

- `initializeMissingPropertiesFromDefaults` (optional)
  Type: boolean
  
  Flag indicating whether missing properties should be initialized with default values.
  
  default: false
  
  Example:
  
  ```json
  true
  ```