Skip to main content

Message Structure

AuthRequest​

Description​

WebSocket authentication request

First-message authentication flow for the Studio self-domain endpoint and LAN Studio environments; not used in production or cloud environments.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: AuthRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataobjectYesBusiness parameters.
data.authTypestringNoAuthentication type. Pass token.
Fixed value: token. Default: token.
data.tokenstringYesUse the format Bearer <Token>, where <Token> is the raw token obtained from Aqara Studio. Do not log or expose this token.

Example​

bearerToken

{
"type": "AuthRequest",
"version": "v1",
"msgId": "10001",
"data": {
"authType": "token",
"token": "<accessToken>",
"clientId": "<clientId>"
}
}

AuthResponse​

Description​

WebSocket authentication response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: AuthResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

Example​

success

{
"type": "AuthResponse",
"version": "v1",
"msgId": "10001",
"data": "",
"code": 0,
"message": "Authentication successful. Welcome <username>"
}

PingRequest​

Description​

Heartbeat request

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: ping.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullNoBusiness parameters.
Default: null.

Example​

ping

{
"type": "ping",
"version": "v1",
"msgId": "10002",
"data": null
}

PongResponse​

Description​

Heartbeat response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: pong.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastringYesFixed value: pong.
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

Example​

pong

{
"type": "pong",
"version": "v1",
"msgId": "10002",
"data": "pong",
"code": 0,
"message": "success"
}

SubscribeAllRequest​

Description​

Subscribe to all or selected devices request

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeAllRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<string> or nullNoList of device IDs. When null, omitted, or an empty array, this subscribes to all device data within the current permission scope and clears previously established device-level subscriptions.
When data is non-empty, the “subscribe all devices” state is cancelled and these device-level subscriptions are appended, but previously appended device-level subscriptions are not automatically cleared.
To narrow or replace the device-level subscription scope, first use UnsubscribeAllRequest to remove devices that are no longer needed.
To clear all device-data and Trait subscriptions on the current connection, send UnsubscribeAllRequest with an empty data array or omit data; this request does not clear standalone event or object-event subscriptions.
If the current account or token permission scope has no accessible devices, the server may return code=0 but no subsequent push messages will be generated.
Within the same connection, SubscribeAllRequest overrides and clears Trait subscriptions previously established via SubscribeTraitValueRequest.
To switch from all-device or selected-device subscriptions back to Trait-only subscriptions, first send UnsubscribeAllRequest to clear the all-device/device-level subscriptions.
Default: null.

Example​

{
"type": "SubscribeAllRequest",
"version": "v1",
"msgId": "1751609244328",
"data": null
}

SubscribeAllResponse​

Description​

Subscribe to all or selected devices response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeAllResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

UnsubscribeAllRequest​

Description​

Unsubscribe from all or selected devices request

Clears subscriptions for all or selected device data and also clears Trait subscriptions for the current session. It does not clear standalone event subscriptions or precise object-event subscriptions, and it does not disable the default DEVICE_ADDED and DEVICE_REMOVED events received on authenticated connections.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeAllRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<string> or nullNoList of device IDs. Empty or null means unsubscribe from all device-data and Trait subscriptions.
If the current connection is subscribed to all devices, unsubscribing by specific device IDs has no effect; an empty value must be passed to cancel all device-data subscriptions.
Within the same connection, UnsubscribeAllRequest also clears Trait subscriptions previously established via SubscribeTraitValueRequest.
Unsubscribing specific devices only removes device-level subscriptions and does not mean stopping all push messages on the current connection.
This request does not clear rules established by SubscribeEventRequest or SubscribeObjectEventRequest, nor does it disable the default DEVICE_ADDED and DEVICE_REMOVED push messages.
Default: null.

UnsubscribeAllResponse​

Description​

Unsubscribe from all or selected devices response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeAllResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

SubscribeTraitValueRequest​

Description​

Subscribe to specified Trait values request

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeTraitValueRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<object>YesList of Traits to subscribe to. A non-empty array is recommended; omitting data causes parsing to fail.
In the current implementation, an empty array or empty traitCodes may still return a success response, but no effective TraitValueUpdate subscription will be created.
data[].deviceIdstringYesDevice ID.
data[].endpointIdinteger (int32)YesEndpoint ID.
data[].functionCodestringYesFunction code.
data[].traitCodesarray<string>YesList of Trait feature point codes. A non-empty array is recommended; an empty array does not create or cancel any specific Trait subscriptions, although the current implementation may still return a success response.

Example​

subscribeTrait

{
"type": "SubscribeTraitValueRequest",
"version": "v1",
"msgId": "get_devices_1751609244328",
"data": [
{
"deviceId": "57190441014857",
"endpointId": 3,
"functionCode": "MediaPlayback",
"traitCodes": [
"TargetPlaybackState"
]
}
]
}

SubscribeTraitValueResponse​

Description​

Subscribe to specified Trait values response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeTraitValueResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

TraitValueUpdate​

Description​

Trait Value Update

After subscribing to all traits of a specified device through SubscribeAllRequest or subscribing to a specified Trait of a specified device through SubscribeTraitValueRequest, when the value of the target Trait changes, Aqara Studio will push this message to you. For information on Aqara's existing Traits and their data types, see Aqara Data Model Tags.

All business notifications now carry studioId/eventId pair; ordinary historical messages allow omission for compatibility with legacy producers. Ordinary request/response messages do not reference this structure. Execution results and the four new scene object events have additional identity constraints.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: TraitValueUpdate.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<object>YesPush payload data.
data[].deviceIdstringYesDevice ID.
data[].endpointIdinteger (int32)YesEndpoint ID.
data[].functionCodestringYesFunction code.
data[].traitCodestringYesTrait feature point code.
data[].valueanyNoTrait feature point value. The actual type is determined by the specific feature point definition.
data[].timeinteger (int64)YesReport timestamp in milliseconds.
eventIdstringNoAn opaque string for this logical notification. It must contain at least one non-whitespace character. Store and compare it as-is without relying on its format. It remains unchanged across channels and HTTP retries. Consecutive notifications with the same content use different values.
Minimum length: 1. Pattern: \S.
studioIdstringNoThe official Studio identity that publishes the notification. It must contain at least one non-whitespace character. It is not a gateway identity or an authentication credential.
Minimum length: 1. Pattern: \S.
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

eventId and studioId must appear together.

Example​

{
"type": "TraitValueUpdate",
"eventId": "449fd6f6-c52c-4488-a3a2-000000000001",
"studioId": "studio-example",
"version": "v1",
"msgId": "10810",
"data": [
{
"deviceId": "57190441014857",
"endpointId": 0,
"functionCode": "BasicInformation",
"traitCode": "Reachable",
"value": true,
"time": 1794637886352
}
],
"code": 0,
"message": ""
}

UnsubscribeTraitValueRequest​

Description​

Unsubscribe from specified Trait values request

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeTraitValueRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<object>NoList of Traits to unsubscribe from. A non-empty array is recommended.
Omitting data, passing an empty array, or using empty traitCodes will not cancel any Trait subscriptions, although the current implementation may still return a success response.
Default: [].
data[].deviceIdstringYesDevice ID.
data[].endpointIdinteger (int32)YesEndpoint ID.
data[].functionCodestringYesFunction code.
data[].traitCodesarray<string>YesList of Trait feature point codes. A non-empty array is recommended; an empty array does not create or cancel any specific Trait subscriptions, although the current implementation may still return a success response.

UnsubscribeTraitValueResponse​

Description​

Unsubscribe from specified Trait values response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeTraitValueResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

SubscribeEventRequest​

Description​

Subscribe Alarm Request

Send after authentication. data must be a non-empty array of event types. Ordinary clients use ALARM. The subscription applies to the current session only, and repeated requests are idempotent. This does not affect device, Trait, or object event subscriptions.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeEventRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<string>YesUse ALARM for alarms; do not accept empty arrays, wildcards, or object ID filters.
Minimum items: 1. Fixed item value: ALARM.

Example​

subscribeAlarmRequest

{
"type": "SubscribeEventRequest",
"version": "v1",
"msgId": "alarm-subscribe-1",
"data": [
"ALARM"
]
}

SubscribeEventResponse​

Description​

Subscribe Alarm Response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeEventResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

Example​

subscribeAlarmResponse

{
"type": "SubscribeEventResponse",
"version": "v1",
"msgId": "alarm-subscribe-1",
"data": "",
"code": 0,
"message": "success"
}

AlarmEvent​

Description​

Raw Alarm Push

Delivered only to sessions that explicitly subscribe to ALARM. SubscribeAllRequest and object event subscriptions do not enable this implicitly. Alarms are independent of App notification-bar pushes. Delivery is not limited to OFF_NORMAL; consume the sourceState actually published by the alarm source. Only real-time pushes are supported, and historical alarms are not redelivered. Re-subscribe after disconnection. msgId is for tracing only and is not a globally unique event ID.

WebSocket and HTTP shared raw alarm-push payload. WebSocket explicitly subscribes to ALARM to receive, and HTTP enables alarms according to configuration; does not use the app notification payload.

All business notifications now carry studioId/eventId pair; ordinary historical messages allow omission for compatibility with legacy producers. Ordinary request/response messages do not reference this structure. Execution results and the four new scene object events have additional identity constraints.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: AlarmEvent.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataobjectYesPush payload data.
data.uuidstringYesAlarm record ID. Subsequent events for the same alarm record may reuse this value; it is not a unique event ID for each state change.
data.deviceNamestringYesDisplay name of the device.
data.deviceIdstringYesDevice ID. May be an empty string when the device cannot be resolved.
data.devicePointNamestringYesDisplay name of the alarm point.
data.alarmClassstringYesDisplay name of the alarm class.
data.alarmRuleNamestringYesDisplay name of the alarm rule. May fall back to the point name.
data.alarmTextstringYesAlarm display text.
data.alarmValuestringYesFormatted alarm value as a string.
data.sourceStatestringYesStandard status of the alarm source, including NORMAL (normal), OFF_NORMAL (triggered), FAULT (fault), and ALERT (alert). Values are provided based on the actual alarm event and do not imply that every status or acknowledgment action produces a separate push. Receivers should remain compatible with future added values.
data.alarmTimeinteger (int64)YesUnix millisecond timestamp.
data.localizedobjectYesProvides text by language tag. Some languages may be absent when localized text generation fails; in that case, the top-level text uses the system default language or an available fallback language.
Minimum properties: 1.
data.localized.*.devicePointNamestringYesDisplay name of the alarm point.
data.localized.*.alarmTextstringYesAlarm display text.
data.localized.*.alarmValuestringYesAlarm value.
data.localized.*.sourceStateTextstringYesAlarm source state display text.
eventIdstringNoAn opaque string for this logical notification. It must contain at least one non-whitespace character. Store and compare it as-is without relying on its format. It remains unchanged across channels and HTTP retries. Consecutive notifications with the same content use different values.
Minimum length: 1. Pattern: \S.
studioIdstringNoThe official Studio identity that publishes the notification. It must contain at least one non-whitespace character. It is not a gateway identity or an authentication credential.
Minimum length: 1. Pattern: \S.
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

eventId and studioId must appear together.

Example​

alarmTriggered

{
"version": "v1",
"msgId": "alarm-notify-alarm-1",
"type": "AlarmEvent",
"data": {
"uuid": "alarm-1",
"deviceName": "Smoke sensor",
"deviceId": "device-1",
"devicePointName": "Smoke concentration",
"alarmClass": "Critical",
"alarmRuleName": "Smoke rule",
"alarmText": "Smoke detected",
"alarmValue": "On",
"sourceState": "OFF_NORMAL",
"alarmTime": 1793577600000,
"localized": {
"zh-CN": {
"devicePointName": "烟雾浓度",
"alarmText": "检测到烟雾",
"alarmValue": "开启",
"sourceStateText": "触发"
},
"en-US": {
"devicePointName": "Smoke concentration",
"alarmText": "Smoke detected",
"alarmValue": "On",
"sourceStateText": "Triggered"
}
}
},
"code": 0,
"message": "success"
}

UnsubscribeEventRequest​

Description​

Unsubscribe Alarm Request

Send after authentication. data must be a non-empty array of event types. Ordinary clients use ALARM. The subscription applies to the current session only, and repeated requests are idempotent. This does not affect device, Trait, or object event subscriptions.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeEventRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<string>YesUse ALARM for alarms; do not accept empty arrays, wildcards, or object ID filters.
Minimum items: 1. Fixed item value: ALARM.

Example​

unsubscribeAlarmRequest

{
"type": "UnsubscribeEventRequest",
"version": "v1",
"msgId": "alarm-unsubscribe-1",
"data": [
"ALARM"
]
}

UnsubscribeEventResponse​

Description​

Unsubscribe Alarm Response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeEventResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

Example​

unsubscribeAlarmResponse

{
"type": "UnsubscribeEventResponse",
"version": "v1",
"msgId": "alarm-unsubscribe-1",
"data": "",
"code": 0,
"message": "success"
}

SubscribeObjectEventRequest​

Description​

Subscribe to space, device-space relationship, and automation object events

Incrementally adds object-event subscriptions for the current WebSocket session; duplicate subscriptions are idempotent.

When objectIds is omitted, null, or an empty array, subscribe to all currently accessible objects under the specified eventTypes; when non-empty, subscribe only to the specified objects. Subsequent subscription requests are merged with existing rules and do not overwrite previously specified object rules. Subscribing to all objects replaces the existing ID list for the same event type. Apps may use all-object subscriptions to maintain a complete list; screen devices and third-party services typically subscribe to specified objects according to their business scope.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeObjectEventRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<object>YesMust contain 1 to 100 subscription items. Requests are merged incrementally by session, and duplicate subscriptions are idempotent.
SPACE_ADDED, AUTOMATION_ADDED, and SCENE_ADDED only allow the all-objects semantic for objectIds.
Minimum items: 1. Maximum items: 100.
data[].eventTypesarray<string>YesMinimum items: 1. Items must be unique.
Allowed item values
  • DEVICE_SPACE_UPDATED: The device's space changed.
  • SPACE_ADDED: Space added.
  • SPACE_REMOVED: Space removed.
  • SPACE_UPDATED: Space updated.
  • AUTOMATION_ADDED: Automation added.
  • AUTOMATION_REMOVED: Automation removed.
  • AUTOMATION_UPDATED: Automation updated.
  • AUTOMATION_SPACE_UPDATED: The automation's space changed.
  • AUTOMATION_EXECUTION_RESULT: Automation execution result.
  • SCENE_EXECUTION_RESULT: Scene execution result.
  • SCENE_ADDED: Scene added.
  • SCENE_REMOVED: Scene removed.
  • SCENE_UPDATED: Scene updated.
  • SCENE_SPACE_UPDATED: The scene's space changed.
data[].objectIdsarray<string> or nullNoList of object IDs. Fill in device, space, automation, or scene IDs according to the event types.
When subscribing, omitted, null, or empty objectIds means all objects within the current permission scope; when non-empty, only the specified objects are matched.
When unsubscribing, omitted, null, or empty objectIds means clearing all rules for the corresponding eventTypes; when non-empty, only the specified objects are removed.
Within the same WebSocket session, at most 1000 distinct objectIds may be cumulatively subscribed under each eventType.
When objectIds is non-empty, the eventTypes in the same item must belong to the same public ID family (device, space, automation/scene); SPACE_ADDED, AUTOMATION_ADDED, and SCENE_ADDED support only the all-objects semantic.
Maximum items: 1000. Items must be unique. Minimum item length: 1.

Example​

{
"type": "SubscribeObjectEventRequest",
"version": "v1",
"msgId": "object-subscribe-1",
"data": [
{
"eventTypes": [
"SPACE_ADDED",
"SPACE_REMOVED",
"SPACE_UPDATED",
"AUTOMATION_ADDED",
"AUTOMATION_REMOVED",
"AUTOMATION_UPDATED",
"AUTOMATION_SPACE_UPDATED",
"DEVICE_SPACE_UPDATED"
],
"objectIds": []
}
]
}

SubscribeObjectEventResponse​

Description​

Object-event subscription response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: SubscribeObjectEventResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

ObjectEvent​

Description​

Object event push

Device add/remove events are pushed by default; changes to spaces, automations, standalone scenes, and space relationships are delivered according to precise object subscriptions. Current 19 object event types are provided with examples.

DEVICE_ADDED and DEVICE_REMOVED are pushed by default after an authenticated connection is established.

DEVICE_SPACE_UPDATED, the three SPACE_* changes, the four AUTOMATION_* changes, the four SCENE_* changes, and AUTOMATION_EXECUTION_RESULT and SCENE_EXECUTION_RESULT are delivered only to SubscribeObjectEventRequest sessions that match the eventType, objectId, and current permissions.

DEVICE_ENDPOINT_* and DEVICE_TRAIT_PARAMETER_UPDATE continue to follow the existing device-data subscriptions.

Independent scenes are managed through /scenes, and change notifications use four SCENE_* event families, still using AUTOMATION_* for automation. Trustworthiness is determined by the server. No separate event is provided for count changes. Creating or deleting an automation sends only the corresponding lifecycle snapshot and does not additionally send a space-relationship event. For an existing object, AUTOMATION_SPACE_UPDATED is sent only when its space relationship changes. If both the content and the relationship change at the same time, both types of events may be received.

Independent scenes use SCENE_ADDED/REMOVED/UPDATED/SPACE_UPDATED, no longer sending AUTOMATION_*; the sceneId still uses the auto_ prefix. Old automation manual entries still belong to automation. Scene definition comparison excludes space, and space and definition changes in the same batch generate two different eventId notifications.

The manualTriggers field in an automation snapshot contains triggerNodeId and triggerName. Adding, deleting, or renaming a manual trigger entry returns the full list through AUTOMATION_UPDATED. Replace the cache with the full list, and clear previous entries when the array is empty. No additional event subscription type is required.

msgId is used only for trace correlation. New business notifications are idempotent by studioId + eventId; old object changes without a common identity are idempotently handled based on object state, and should not be deduplicated solely by objectId, eventType, or time.

The new AUTOMATION_EXECUTION_RESULT and SCENE_EXECUTION_RESULT events notify per effective action record, for automations and scenes respectively. They are not completion events for an entire execution. Both Studio and Gateway are covered. A native optimization is notified once per native call. An unconfirmed result is unknown and is not expanded into per-device successes.

The two new events and the four independent scene changes must carry the common-layer studioId and eventId. The same notification identity is kept across channels and HTTP retries. The action results can be trimmed according to the receiver's permissions. They are idempotent by studioId + eventId. executionId only correlates an execution and is explicitly null when unavailable. A new subscription may receive records that the shared queue has not yet delivered. Historical replay is not provided.

All business notifications now carry studioId/eventId pair; ordinary historical messages allow omission for compatibility with legacy producers. Ordinary request/response messages do not reference this structure. Execution results and the four new scene object events have additional identity constraints.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: objectEvent.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataobjectYesGeneric data for objectEvent. The currently known values are listed under eventType, but the receiving side should treat it as an extensible string.
When HTTP ALL_SUPPORTED is selected, Studio may, after an upgrade, send events and data structures that are not listed in older versions of the documentation.
data.eventTypestringYesExtensible object event type; see KnownPushObjectEventType for currently known values.
Minimum length: 1.
data.objectIdstringYesObject ID; by event type, device, space, automation, or scene ID. The scene value still uses auto_<nodeID> and cannot be classified by the ID prefix.
data.timeinteger (int64)YesEvent timestamp in milliseconds.
data.dataobject or nullNoThe concrete structure is determined by eventType. The current structures are described by PushObjectEventDeviceData, PushObjectEventTraitParameterData, DeviceSpaceUpdateEventData, SpaceEventData, AutomationPushSnapshot, AutomationSpaceUpdateEventData, ScenePushSnapshot, SceneSpaceUpdateEventData and ExecutionResultData.
Future new structures may be added on the push side; PreciseObjectEventType in subscription requests remains a strict enum in the current version.
eventIdstringNoAn opaque string for this logical notification. It must contain at least one non-whitespace character. Store and compare it as-is without relying on its format. It remains unchanged across channels and HTTP retries. Consecutive notifications with the same content use different values.
Minimum length: 1. Pattern: \S.
studioIdstringNoThe official Studio identity that publishes the notification. It must contain at least one non-whitespace character. It is not a gateway identity or an authentication credential.
Minimum length: 1. Pattern: \S.
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

eventId and studioId must appear together.

When data.eventType is DEVICE_ADDED, DEVICE_REMOVED, DEVICE_ENDPOINT_ADDED, DEVICE_ENDPOINT_REMOVED, data.data is required and has the PushObjectEventDeviceData structure:
ParameterTypeRequiredDescription
data.data.deviceIdstringYesDevice ID.
data.data.namestringYesDevice name.
data.data.deviceTypesListarray<string>YesList of device types.
data.data.endpointIdsarray<integer (int32)>YesList of endpoint IDs.
data.data.timeinteger (int64)YesEvent timestamp in milliseconds.
When data.eventType is DEVICE_TRAIT_PARAMETER_UPDATE, data.data is required and has the PushObjectEventTraitParameterData structure:
ParameterTypeRequiredDescription
data.data.deviceIdstringYesDevice ID.
data.data.endpointIdinteger (int32) or nullNoEndpoint ID.
data.data.functionCodestring or nullNoFunction code.
data.data.traitCodestring or nullNoTrait feature point code.
data.data.newValueobject or nullNoUpdated Trait parameter value; when empty, this field may be omitted during serialization.
data.data.newValue.endpointIdinteger (int32) or nullNoEndpoint ID.
data.data.newValue.functionCodestring or nullNoFunction code.
data.data.newValue.traitCodestring or nullNoTrait feature point code.
data.data.newValue.minnumber or nullNoMinimum value.
data.data.newValue.maxnumber or nullNoMaximum value.
data.data.newValue.unitstring or nullNoUnit.
data.data.newValue.stepnumber or nullNoStep size.
data.data.oldValueobject or nullNoPrevious Trait parameter value; when empty, this field may be omitted during serialization.
data.data.oldValue.endpointIdinteger (int32) or nullNoEndpoint ID.
data.data.oldValue.functionCodestring or nullNoFunction code.
data.data.oldValue.traitCodestring or nullNoTrait feature point code.
data.data.oldValue.minnumber or nullNoMinimum value.
data.data.oldValue.maxnumber or nullNoMaximum value.
data.data.oldValue.unitstring or nullNoUnit.
data.data.oldValue.stepnumber or nullNoStep size.
When data.eventType is DEVICE_SPACE_UPDATED, data.data is required and has the DeviceSpaceUpdateEventData structure:
ParameterTypeRequiredDescription
data.data.deviceIdstringYesDevice ID.
data.data.oldSpaceIdstring or nullYesSpace ID before the change; null when associated for the first time.
data.data.spaceobject or nullYesSpace summary at the time the relationship changes; null when the relationship is removed. Read the space ID from space.spaceId; subsequent name, marking, or parent changes should update a unified space cache via SPACE_UPDATED.
data.data.space.spaceIdstringYesSpace ID.
data.data.space.namestringYesSpace name.
data.data.space.spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.space.parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
When data.eventType is SPACE_ADDED, SPACE_REMOVED, SPACE_UPDATED, data.data is required and has the SpaceEventData structure:

Latest space summary. The client should maintain a unified space cache by spaceId to avoid repeatedly storing potentially stale names, markings, and parent relationships in device or automation relationship data; parentSpaceId indicates the parent space of the summary, and is null for a root space.

ParameterTypeRequiredDescription
data.data.spaceIdstringYesSpace ID.
data.data.namestringYesSpace name.
data.data.spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
When data.eventType is AUTOMATION_ADDED, AUTOMATION_REMOVED, AUTOMATION_UPDATED, data.data is required and has the AutomationPushSnapshot structure:

Lightweight snapshot used for automation object changes; does not include the full config. Query details via GET /automations/{automationId}. manualTriggers is the complete replacement list of manual trigger entries inside the old automation; standalone scenes use ScenePushSnapshot. Use the last stable merge baseline for deletion.

ParameterTypeRequiredDescription
data.data.automationIdstringYesAutomation ID.
data.data.definitionTypestringYesAutomation definition type.
data.data.namestringYesAutomation name.
data.data.enabledbooleanYesWhether it is enabled.
data.data.createTimeinteger (int64)YesCreation timestamp in milliseconds.
data.data.manualTriggersarray<object>NoComplete list of manual trigger entries in the automation. When an entry is added, deleted, or renamed, AUTOMATION_UPDATED pushes the full snapshot after the change. The receiver should replace the cache as a whole. An empty array clears the cache, and a missing field may be treated as an empty array for compatibility. For additions, the list after the addition is used; for deletions, the list before the deletion is used. This list does not represent an independent /scenes object.
Default: [].
data.data.manualTriggers[].triggerNodeIdstringYesManual trigger node ID. Used together with the parent automationId to locate the entry.
data.data.manualTriggers[].triggerNamestringYesDisplay name of the manual trigger entry.
When data.eventType is AUTOMATION_SPACE_UPDATED, data.data is required and has the AutomationSpaceUpdateEventData structure:
ParameterTypeRequiredDescription
data.data.automationIdstringYesAutomation ID.
data.data.oldSpaceIdstring or nullNoCompatibility field. Uses the first item of oldSpaceIds. null or omitted when there is no previous association.
data.data.spaceobject or nullNoCompatibility field. Uses the first item of spaces. null or omitted when there is no new association. The complete relationship is defined by spaces. Independent scenes use SCENE_SPACE_UPDATED.
data.data.space.spaceIdstringYesSpace ID.
data.data.space.namestringYesSpace name.
data.data.space.spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.space.parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
data.data.oldSpaceIdsarray<string>YesComplete list of associated space IDs before the change. [] when there is no previous association.
data.data.spacesarray<object>YesComplete array of space summaries after the change. [] when no association can be resolved. The client replaces the relationship as a whole. The event is still sent when other spaces change, even if the first item stays the same. Name, marking, and parent changes update the unified space cache through SPACE_UPDATED.
data.data.spaces[].spaceIdstringYesSpace ID.
data.data.spaces[].namestringYesSpace name.
data.data.spaces[].spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.spaces[].parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
When data.eventType is AUTOMATION_EXECUTION_RESULT, SCENE_EXECUTION_RESULT, data.data is required and has the ExecutionResultData structure:

Immutable business payload for one effective action record. Keys declared nullable are always present and explicitly null. Names use the Studio default language.

ParameterTypeRequiredDescription
data.data.objectIdstringYesPublic automation or scene ID, identical to the outer objectId.
Minimum length: 1.
data.data.namestringYesSnapshot of the object name at the time the record was received.
data.data.executionIdstring or nullYesOpaque execution correlation. null when unreliable. Do not use it to deduplicate different actions or to decide that the whole execution has finished.
data.data.triggeredAtinteger or nullYesTrusted trigger time of the original execution chain, in Unix milliseconds. null when unknown. A nested scene may inherit the originating time.
data.data.actionOccurredAtinteger or nullYesTrusted time when the upstream action result occurred, in Unix milliseconds. null when not provided. Do not fill in the receive time.
data.data.executeModestringYesThe actual executor. Studio remains Studio when it controls a device through a gateway.
Allowed values
  • Studio
  • Gateway
data.data.resultCodeintegerYes0 means this record succeeded or is non-failure under the existing business rules, 1 means failure, and 2 means unknown. It does not summarize the whole execution or indicate that a physical action completed.
Allowed values
  • 0
  • 1
  • 2
data.data.actionKindstringYesStable action category, such as device_write, variable_set, flow_invoke, or native_scene_recall. Unknown categories added in the future must be tolerated.
Minimum length: 1.
data.data.actionTargetobject or nullYesSummary of the target identity and its name in the default language. A resource is provided only when it can be mapped reliably. Content the caller is not permitted to see is explicitly empty. Clients must tolerate new target categories.
data.data.actionTarget.typestring or nullYes—
data.data.actionTarget.idstring or nullYes—
data.data.actionTarget.namestring or nullYes—
data.data.actionTarget.resourceIdstring or nullYes—
data.data.actionTarget.resourceNamestring or nullYes—
data.data.triggerSourceobjectYes—
data.data.triggerSource.sourceTypeintegerYesReuses the trigger-source protocol code. The fine-grained trigger category cannot be inferred from this code alone.
data.data.triggerSource.triggerSubjectIdstring or nullYes—
data.data.triggerSource.triggerSubjectNamestring or nullYes—
data.data.triggerSource.triggerResourceIdstring or nullYes—
data.data.triggerSource.triggerResourceNamestring or nullYes—
data.data.spacesarray<object>YesAll associated space summaries that can be provided. [] when there is no association.
data.data.spaces[].spaceIdstringYesSpace ID.
data.data.spaces[].namestringYesSpace name.
data.data.spaces[].spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.spaces[].parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
When data.eventType is SCENE_ADDED, SCENE_REMOVED, SCENE_UPDATED, data.data is required and has the ScenePushSnapshot structure:

Lightweight snapshot of an independent scene. objectId matches the outer value and is the sceneId returned by the scenes query (auto_ prefix). It does not include enabled, manualTriggers, or the full action configuration. Deletion uses the last stable merged baseline.

ParameterTypeRequiredDescription
data.data.objectIdstringYesMinimum length: 1.
data.data.namestringYes—
data.data.createTimeinteger (int64)Yes—
data.data.spacesarray<object>YesComplete effective space summaries, including calculated inherited results. An empty array when there is no effective relationship.
data.data.spaces[].spaceIdstringYesSpace ID.
data.data.spaces[].namestringYesSpace name.
data.data.spaces[].spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.spaces[].parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.
When data.eventType is SCENE_SPACE_UPDATED, data.data is required and has the SceneSpaceUpdateEventData structure:

Full replacement of a scene's space relationships. The compatibility single values oldSpaceId and space are not provided. After direct relationships are cleared, inherited spaces may still remain.

ParameterTypeRequiredDescription
data.data.objectIdstringYesMinimum length: 1.
data.data.oldSpaceIdsarray<string>Yes—
data.data.spacesarray<object>Yes—
data.data.spaces[].spaceIdstringYesSpace ID.
data.data.spaces[].namestringYesSpace name.
data.data.spaces[].spatialMarkingstring or nullNoSpace marking; null when no marking exists.
data.data.spaces[].parentSpaceIdstring or nullYesParent space ID of the space; null for a root space. For SPACE_ADDED and SPACE_UPDATED this is the parent space after the event; for SPACE_REMOVED it is the parent space before deletion.

eventId: UUID of this logical notification. It remains unchanged across channels and HTTP retries.

studioId: The Studio official identity for publishing the notification, not the executing gateway ID. Minimum length: 1.

When data.eventType is AUTOMATION_EXECUTION_RESULT, SCENE_EXECUTION_RESULT, SCENE_ADDED, SCENE_REMOVED, SCENE_UPDATED, SCENE_SPACE_UPDATED, eventId, studioId are required.

Example​

{
"type": "objectEvent",
"version": "v1",
"msgId": "trace-scene_added",
"eventId": "449fd6f6-c52c-4488-a3a2-000000000020",
"studioId": "studio-example",
"code": 0,
"message": "success",
"data": {
"eventType": "SCENE_ADDED",
"objectId": "auto_scene001",
"time": 1793836800123,
"data": {
"objectId": "auto_scene001",
"name": "Movie scene",
"createTime": 1793836800000,
"spaces": []
}
}
}

UnsubscribeObjectEventRequest​

Description​

Unsubscribe from space, device-space relationship, and automation object events

Removes specified object rules or clears specified event types for the current WebSocket session.

When objectIds is non-empty, only the specified objects are removed; when omitted, null, or an empty array, all object rules for the corresponding eventTypes are cleared. All-object subscriptions do not support excluding selected objects. To switch from all objects to specified objects, first clear the event type and then send a new specified-object subscription.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeObjectEventRequest.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataarray<object>YesMust contain 1 to 100 unsubscribe items; an empty array is a parameter error and does not mean unsubscribing from all event types.
When objectIds is omitted, null, or an empty array, all object rules under the corresponding eventTypes for the current session are removed; when non-empty, only the specified objects are removed.
Minimum items: 1. Maximum items: 100.
data[].eventTypesarray<string>YesMinimum items: 1. Items must be unique.
Allowed item values
  • DEVICE_SPACE_UPDATED: The device's space changed.
  • SPACE_ADDED: Space added.
  • SPACE_REMOVED: Space removed.
  • SPACE_UPDATED: Space updated.
  • AUTOMATION_ADDED: Automation added.
  • AUTOMATION_REMOVED: Automation removed.
  • AUTOMATION_UPDATED: Automation updated.
  • AUTOMATION_SPACE_UPDATED: The automation's space changed.
  • AUTOMATION_EXECUTION_RESULT: Automation execution result.
  • SCENE_EXECUTION_RESULT: Scene execution result.
  • SCENE_ADDED: Scene added.
  • SCENE_REMOVED: Scene removed.
  • SCENE_UPDATED: Scene updated.
  • SCENE_SPACE_UPDATED: The scene's space changed.
data[].objectIdsarray<string> or nullNoList of object IDs. Fill in device, space, automation, or scene IDs according to the event types.
When subscribing, omitted, null, or empty objectIds means all objects within the current permission scope; when non-empty, only the specified objects are matched.
When unsubscribing, omitted, null, or empty objectIds means clearing all rules for the corresponding eventTypes; when non-empty, only the specified objects are removed.
Within the same WebSocket session, at most 1000 distinct objectIds may be cumulatively subscribed under each eventType.
When objectIds is non-empty, the eventTypes in the same item must belong to the same public ID family (device, space, automation/scene); SPACE_ADDED, AUTOMATION_ADDED, and SCENE_ADDED support only the all-objects semantic.
Maximum items: 1000. Items must be unique. Minimum item length: 1.

Example​

{
"type": "UnsubscribeObjectEventRequest",
"version": "v1",
"msgId": "object-unsubscribe-1",
"data": [
{
"eventTypes": [
"AUTOMATION_UPDATED"
],
"objectIds": [
"automation-1"
]
}
]
}

UnsubscribeObjectEventResponse​

Description​

Object-event unsubscription response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: UnsubscribeObjectEventResponse.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
datastring or nullYesResponse data. When no data is returned, it is usually an empty string or null.
Default: "".
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

CommandReport​

Description​

Gateway command execution result

Sent with v1 device-level or full-device subscriptions, preserving the original gateway result without indicating that the device physical action has been completed.

All business notifications now carry studioId/eventId pair; ordinary historical messages allow omission for compatibility with legacy producers. Ordinary request/response messages do not reference this structure. Execution results and the four new scene object events have additional identity constraints.

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: CommandReport.
versionstringYesFixed value: v1.
msgIdstringYesA non-empty identifier used by the request. It should remain unique at least among unfinished requests on the current connection. Normal responses correlate with the same msgId, while msgIds on server push messages are used only for link tracing, do not correspond to subscription request msgIds, and are not guaranteed to be globally unique.
Minimum length: 1. Maximum length: 64.
dataobjectYesPush payload data.
data.deviceIdstringYesMinimum length: 1.
data.sequenceintegerYesMinimum: 1.
data.timestampintegerYesStudio recorded time
Minimum: 0.
data.didstringYesMinimum length: 1.
data.reportTimeinteger or nullYesGateway original report time
data.sourcestring or nullYes—
data.dataobjectYesAdditional properties are allowed.
data.contentobjectYesAdditional properties are allowed.
eventIdstringNoAn opaque string for this logical notification. It must contain at least one non-whitespace character. Store and compare it as-is without relying on its format. It remains unchanged across channels and HTTP retries. Consecutive notifications with the same content use different values.
Minimum length: 1. Pattern: \S.
studioIdstringNoThe official Studio identity that publishes the notification. It must contain at least one non-whitespace character. It is not a gateway identity or an authentication credential.
Minimum length: 1. Pattern: \S.
codeinteger (int32)YesProcessing result code. 0 indicates success, and any non-zero value indicates failure.
messagestring or nullYesProcessing result message.

eventId and studioId must appear together.

Example​

command_report

{
"type": "CommandReport",
"version": "v1",
"msgId": "report-example",
"studioId": "studio-example",
"eventId": "449fd6f6-c52c-4488-a3a2-828db5f9ab6e",
"code": 0,
"message": "success",
"data": {
"deviceId": "device-1",
"sequence": 1,
"timestamp": 1793577600000,
"did": "gateway-device-example",
"reportTime": null,
"source": null,
"data": {
"2.148.33050.0": "0"
},
"content": {
"0": 0,
"2": 2
}
}
}

ErrorMessage​

Description​

Error response

Parameters​

ParameterTypeRequiredDescription
typestringYesFixed value: ErrorMessage.
versionstringYesFixed value: v1.
msgIdstringYesReturns the original request msgId when it can be correlated; the server may return UNKNOWN or an empty string when it cannot correlate the original request.
Minimum length: 0. Maximum length: 64.
datastring or nullNoError responses typically do not carry business data.
codeinteger (int32)YesProcessing result code. Any non-zero value indicates failure; clients are discouraged from relying on specific error codes for fixed business logic decisions.
messagestring or nullYesError message.

Example​

missingMsgId

{
"type": "ErrorMessage",
"version": "v1",
"msgId": "",
"data": null,
"code": 400,
"message": "Missing msgId"
}