device.property.set (Write properties)
device.property.set: Write properties
What it does
Writes multiple configuration properties in one call. Different models use the same request body (full propertyId keys). Out-of-range values are rejected, not clamped. Do not mix device-level and channel-level properties in one request. A write timeout does not mean the write did not run on the device.
Request URL
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.property.set
Minimum permission
An administrator needs no extra permission on a device they bound. A bound sub-user needs none. For shared devices and sub-accounts, required permission follows each property page’s Minimum permission and Permission codes; the gateway checks internal capability codes—device.capability.list does not return shareAuthCode/subAccountAuthCode. Same rules as device.property.set. The device must be bound.
Request parameters
| Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
token | String | yes | Administrator, sub-user, or sub-account accessToken | ||
deviceId | String | yes | Device serial number | ||
productId | String | no | Optional. If sent and it does not match the device model → DV2009 | ||
channelId | String | conditional | Channel index; IPCs often "0". Do not pass -1. Single-channel IPCs still use "0" | Required for channel-level writes; omit for device-level. Mixing levels in one request returns DV2008 | |
properties | Object | yes | keys are full propertyId | Values to write. Switches: int 0/1. Enums: value. Struct inner keys use field. Members marked required in device.capability.list must be present on a full write; missing members → DV2014 |
Common request fields and signing: Signing and Common request payload.
Request example
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1706511734,
"nonce": "f5a1ae2d-c09c-4d39-a744-83a5c2c653c2"
},
"params": {
"token": "<yourAccessToken>",
"deviceId": "TESTIPC000012345",
"channelId": "0",
"properties": {
"detection.motion.enabled": 1
}
}
}
Response data fields
No business fields. On success, code is "0" and data is {}. code="0" means the entire batch succeeded. The contract does not define partial success.
Response example
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {}
}
}
Error codes
This API may return the codes below.
Gateway and device codes: Global return codes.
