Update the definition of an existing Thing
Updates the definition of the specified thing by providing a new definition URL along with an optional migration payload.
The request body allows specifying:
- A new Thing definition URL.
- A migration payload containing updates to attributes and features.
- Patch conditions to ensure consistent updates.
- Whether properties should be initialized if missing.
Placeholders in migration payload: String values in migrationPayload may use the thing-json
placeholder. Both brace {{ thing-json:<json-pointer> }} and legacy ${ thing-json:<json-pointer> }
are supported.
If the dry-run query parameter or header is set to true, the request will return the calculated migration result without applying any changes.
Example:
{
"thingDefinitionUrl": "https://example.com/new-thing-definition.json",
"migrationPayload": {
"attributes": {
"manufacturer": "New Corp"
},
"features": {
"sensor": {
"properties": {
"status": {
"temperature": {
"value": 25.0
}
}
}
}
}
},
"patchConditions": {
"thing:/features/sensor": "not(exists(/features/sensor))"
},
"initializeMissingPropertiesFromDefaults": true
}Body
JSON payload containing the new definition URL, migration payload, patch conditions, and initialization flag.
JSON payload to migrate the definition of a Thing.
thingDefinitionUrlstring<uri>requiredThe URL of the new Thing definition to be applied.
https://models.example.com/thing-definition-1.0.0.tm.jsonldmigrationPayloadobjectOptional migration payload with updates to attributes and features. String values may contain {{ thing-json: }} 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.
patchConditionsobjectOptional conditions to apply the migration only if the existing thing matches the specified values.
initializeMissingPropertiesFromDefaultsbooleanfalseFlag indicating whether missing properties should be initialized with default values.
trueParameters
thingIdstringrequiredpathThe ID of a thing needs to follow the namespaced entity ID notation (see Ditto documentation on namespaced entity IDs).
dry-runbooleanfalsequeryIf set to true, performs a dry-run and returns the migration result without applying changes.
Response
The thing definition was successfully updated, and the updated Thing is returned.
Dry-run successful. The migration result is returned without applying changes.
The request could not be processed due to invalid input.
Unauthorized request due to missing authentication.
The specified thing could not be found.
The update conditions were not met.
Authorization
OpenIDConnectopenIdConnectOpenID Connect Discovery URL. The placeholder is replaced by Swagger UI when configured.
NginxBasichttp (basic)Eclipse Ditto sandbox demo user (demo1 ... demo9) + password (demo)
Bearerhttp (bearer)A JSON Web Token issued by a supported OAuth 2.0 Identity Provider.