Skip to main content

Batch Query Device Matching Capabilities and Current Trait Values

POST 

/devices/capabilities

Batch-query matching capabilities for the explicit deviceIds list. Always returns a device array, with no pagination. deviceIds is required, and the raw array may contain at most 20 items, including duplicates. After trimming, devices are queried in first-occurrence order with duplicates removed. Provide at least one non-empty list among functionCodes, traitCodes, and commandCodes. List items must not be blank, and array elements are not split by commas. Unknown fields and pageNum/pageSize return 400. All devices use the same filter conditions. Matching rules are identical to GET: conditions of different categories are combined with AND, and an and match for traits or commands requires all codes to match within the same function. If only functionCodes is provided, the complete traits and commands under each matched function are returned. If leaf conditions are provided, only matched leaves are retained. Passing both traitCodes and commandCodes requires a function to satisfy both categories at the same time; this is not a union. If a device is accessible but no capabilities match, the device is retained with endpoints=[]. Devices that do not exist or are inaccessible are omitted. If all devices are omitted, data=[]. Results are ordered by the first occurrence of each requested ID, with no hasMore and no silent truncation. Current trait values are read from Studio's current control points. They are not refreshed from physical devices, and a simultaneous snapshot across devices is not guaranteed. When available, value/time are returned. Null-value fields may be omitted, while false and 0 are returned normally. Commands have no current value. Definitions reuse the ordinary DeviceDefinition and do not include numeric functionId/traitId/commandId/fieldId. The request body is a JSON object directly and is not wrapped in data. The request text may contain at most 1 Mi characters. POST requires separate interface access authorization; GET permission alone does not implicitly grant access. Parameter errors return 400 for the whole batch. Unhandled query exceptions use the unified error response and are not disguised as successful partial results.

Request​

Responses​

Success. data is always an array containing at most 20 devices.