Update a Device
Update the properties of a specified device
Updates any of the following properties of a specified device:
name(orproperties.name)custom_metadatais_managed
Updates a specified device.
You can add or change custom metadata for a device, change the device's name, or convert a managed device to unmanaged.
ID of the device that you want to update.
Name for the device.
Indicates whether the device is managed. To unmanage a device, set is_managed to false.
trueOK
Bad Request
Unauthorized
POST /devices/update HTTP/1.1
Host: connect.getseam.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 166
{
"device_id": "123e4567-e89b-12d3-a456-426614174000",
"properties": {
"name": "text"
},
"name": "text",
"is_managed": true,
"custom_metadata": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}{
"ok": true
}Request
Specify the desired device by including the corresponding device_id in the request body. In addition, in the request body, include the properties that you want to update, along with the desired replacement values.
Request Body Parameters
device_id
String Required
ID of the desired device.
name (or properties.name)
String Optional
Replacement name for the device.
custom_metadata
JSON object Optional
Custom metadata for the device. Specify up to 50 keys, with key names up to 40 characters long. Accepts string or Boolean values. Strings are limited to 500 characters. For more information, see Adding Custom Metadata to Devices.
is_managed
Boolean Optional
Replacement value to indicate whether Seam manages the device.
Sample Request
device_update = seam.devices.update(
device = "30fd243b-3054-4384-a713-5487076a3826",
name = "My Lock",
custom_metadata = {
"internal_account_id": "user-1"
}
)
pprint(device_update)curl -X 'POST' \
'https://connect.getseam.com/devices/update' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ${API_KEY}' \
-H 'Content-Type: application/json' \
-d '{
"device_id": "30fd243b-3054-4384-a713-5487076a3826",
"name": "My Lock",
"custom_metadata": {
"id": "internal_id_1"
}
}'const deviceUpdate = await seam.devices.update({
device_id: "30fd243b-3054-4384-a713-5487076a3826",
name: "My Lock",
custom_metadata: {
"internal_account_id": "user-1"
}
})
console.log(deviceUpdate)device_update = client.devices.update(
device_id: "30fd243b-3054-4384-a713-5487076a3826",
name: "My Lock",
custom_metadata: {
"internal_account_id": "user-1"
}
)
puts device_update.inspect$device_update = $seam->devices->update(
device_id: "30fd243b-3054-4384-a713-5487076a3826",
name: "My Lock",
custom_metadata: array('internal_account_id' => 'user-1')
)
echo json_encode($device_update, JSON_PRETTY_PRINT);Map<String, CustomMetadataValue> customMetadata =
Map.of("internal_account_id", CustomMetadataValue.of(Optional.of("user-1")));
seam.devices().update(DevicesUpdateRequest.builder()
.deviceId("30fd243b-3054-4384-a713-5487076a3826")
.name("My Lock")
.custom_metadata(customMetadata)
.build());Response
Returns a Boolean ok status indicator (with the exception of the Java SDK).
Sample Response
True{
"ok": true
}{ ok: true }{"ok"=>true}trueLast updated
Was this helpful?

