Update device info
PATCH/devices/{deviceId}
Base URL: https://api.tinkermode.com
Update the device with the specified ID. Normally, only the name and description fields of the device instance can be changed. But if the request is made with a Project API Key with "Admin" privileges, the device instance can be moved or added to a home by specifying a homeId field in the request body.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the key of a user or service account with permission to update the home device, or a project API key.
To update the tag, homeId, or channel, the request must be made using the API the key of
a user with permission to update project devices, or a project API key with "Admin" privileges.
Also, to update the homeId with a user API key, the user must have both home devices delete
permission on the current home and create home devices permission on the new home.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceId | integer | Yes | Device ID |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
apiKey | string | No | read-only (server-generated) | API access key assigned to device. Usually hidden except to privileged clients, but is also present during the On-Demand Device Provisioning process. |
bundleInstallTime | string | No | read-only (server-generated); format: date-time | If present, the timestamp when the firmware bundle was installed. |
bundleInstalled | string | No | read-only (server-generated) | If present, the name of firmware bundle installed on this device. |
channel | string | No | read-only (server-generated) | The name of firmware channel the device should download from. |
claimCode | string | No | Claim code assigned to device. Hidden except to privileged clients. | |
claimExpirationTime | string | No | read-only (server-generated); format: date-time | Expiration time of device's claimable state. |
claimTime | string | No | read-only (server-generated); format: date-time | Timestamp of device being claimed by a user. |
creationTime | string | No | read-only (server-generated); format: date-time | Timestamp of device record creation. |
description | string | No | Description of device. | |
deviceClass | string | Yes | read-only (server-generated) | Device Class ID as defined by the project. |
homeId | integer | No | This property is present if device belongs to a home. | |
id | integer | Yes | read-only (server-generated) | Unique device ID. |
isConnected | boolean | No | read-only (server-generated) | Device is currently connected to MODE Cloud via a websocket or MQTT connection. |
lastConnectTime | string | No | read-only (server-generated); format: date-time | The last time the device connected to the cloud. |
lastDisconnectTime | string | No | read-only (server-generated); format: date-time | The last time the device disconnected from the cloud. |
name | string | No | Display name of device. | |
projectId | integer | Yes | read-only (server-generated) | Project that this device belongs to. |
tag | string | No | An optional/informational tag associated with device. Can be used to store the serial number, for example. |
Request example
{
"channel": "stable",
"homeId": 1885,
"name": "new_sensor_name",
"tag": "new_001"
}Responses
204 Successfully updated device properties. There is no return body.
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
404 The requested device does not exist or is not accessible.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |