Specifies values for the properties of a device.

Usage notes

After IoT Platform sends a request to configure device properties, the device receives and processes the request in an asynchronous manner. When you call this operation, a success response indicates that IoT Platform sent a request. The response does not indicate that the device received and processed the request. After the device SDK responds to the request, the device properties are configured.

Important If the Thing Specification Language (TSL) data is of the float or double type, the parameter values that correspond to the TSL data contain at least one decimal place. Examples: 10.0 and 11.1.

QPS limits

You can call this API operation up to 500 times per second per account.

Note The RAM users of an Alibaba Cloud account share the quota of the account.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters


The operation that you want to perform. Set the value to SetDeviceProperty.


The properties that you want to configure. The properties must be in the JSON format.

Each property consists of a combination of a property identifier and a property value in the key:value format. Separate multiple properties with commas (,).

For example, you can configure the following properties for a smart lamp:

  • A switch property whose key is Switch and whose data type is BOOLEAN. The value is 1. The value 1 indicates that the light is on.
  • A color property whose key is Color and whose data type is STRING. The value is blue.

In this case, you can configure the following properties in the JSON format:

Note If you configure properties for the custom module testFb, specify Items={"testFb:Switch":1,"testFb:Color":"blue"}. The testFb module is not the default module.

The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console.

  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If no Overview page or ID is generated for your instance, you do not need to configure this parameter.

For more information, see Overview.


The ProductKey of the product to which the devices belong.

Important If you specify a value for this parameter, you must configure the DeviceName parameter.

The DeviceName of the device.

Important If you configure this parameter, you must specify a value for the ProductKey parameter.

The ID of the device. The ID is a unique identifier that is issued by IoT Platform to the device.

Important The IotId parameter specifies a GUID for the device. The value of the IotId parameter is equivalent to a combination of the values of the ProductKey and DeviceName parameters. If you specify a value for the IotId parameter, you do not need to specify values for the ProductKey and DeviceName parameters. If you specify values for the IotId, ProductKey, and DeviceName parameters, the value of the IotId parameter takes precedence.

The quality of service (QoS) level of the message. Valid values:

  • 0 (default): The system sends the message at most once.
  • 1: The system sends the message at least once. If a PUBACK response is not returned after you publish a QoS 1 message, the message is resent to the device when the device reconnects to IoT Platform.

In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common parameters.

Response parameters


The error code returned if the call fails. For more information, see Error codes.


The data returned if the call is successful.


The ID of the message that IoT Platform sends to the device.

ErrorMessageStringA system exception occurred.

The error message returned if the call fails.


The ID of the request.


Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.


Sample requests

&<Common request parameters>

Sample success responses

XML format


JSON format

  "Success": true, 
  "Data": {

Error codes

For a list of error codes, see Service error codes.