Studio WebSocket API
Version v1
This document describes the asynchronous messages exchanged between the client and the Studio WebSocket service: - The client sends authentication, heartbeat, subscribe, and unsubscribe requests. - Studio returns responses to requests and proactively pushes messages when subscriptions match or device events occur. - This contract covers device, Trait, and object-event subscriptions, but does not cover standalone alarm-event subscriptions such as SubscribeEventRequest and UnsubscribeEventRequest. - For the Studio self-domain endpoint and LAN Studio environments, if the token is not included during the handshake, `AuthRequest` may be sent as the first message after the connection is established. Perspective note: this AsyncAPI describes the integration behavior that client applications need to implement; `send` means the client sends to Studio, and `receive` means the client receives from Studio.
Channels
Messages
Servers
AsyncAPI Specification
asyncapi: 3.0.0
id: urn:studio:websocket:v1
info:
title: Studio WebSocket API
version: v1
description: |
This document describes the asynchronous messages exchanged between the client and the Studio WebSocket service:
- The client sends authentication, heartbeat, subscribe, and unsubscribe requests.
- Studio returns responses to requests and proactively pushes messages when subscriptions match or device events occur.
- This contract covers device, Trait, and object-event subscriptions, but does not cover standalone alarm-event subscriptions such as SubscribeEventRequest and UnsubscribeEventRequest.
- For the Studio self-domain endpoint and LAN Studio environments, if the token is not included during the handshake, `AuthRequest` may be sent as the first message after the connection is established.
Perspective note: this AsyncAPI describes the integration behavior that client applications need to implement; `send` means the client sends to Studio, and `receive` means the client receives from Studio.
defaultContentType: application/json
servers:
lanStudio:
host: '{localStudioEndpoint}'
protocol: ws
pathname: /open/ws
description: LAN Studio WebSocket service, for local connections only; the address is provided by deployment configuration or service discovery and must not be used for production or cloud connections.
variables:
localStudioEndpoint:
default: studio.local
description: The actual Studio host address and environment-specific port. Clients should not hardcode a fixed IP address or port.
channels:
studioWebSocket:
address: null
title: Studio WebSocket channel
description: |
A bidirectional JSON text message channel over a single connection.
New integrations should consistently use `studio-id`; the server currently remains compatible with legacy names such as `X-Studio-Id`, `Studio-Id`, and `studioId`.
The LAN Studio environments may use handshake-header authentication; if Authorization is not provided in the handshake header, the client must send `AuthRequest` within 7 seconds after the connection is established.
When the LAN Studio environments use `AuthRequest`, only `AuthRequest` may be sent before authentication completes; after authentication succeeds, business messages such as heartbeat, subscribe, and unsubscribe may be sent.
The client should periodically send `ping` or another business message to keep the connection alive, and the interval should not exceed 30 seconds. If no message is sent for more than 30 seconds, a gateway or proxy in the path may proactively disconnect the WebSocket connection.
When an API AccessToken is used with a configured access scope, device/Trait subscriptions require authorization for `POST /api/v1/devices/trait/read`, or alternatively `*`. Object-event subscription is a hidden default capability available on authenticated connections and does not require an additional scope.
After the WebSocket connection is established, the client should immediately start message reception and temporary buffering, then complete authentication, restore subscriptions, and perform snapshot reconciliation to avoid missing the default device add/remove events pushed after authentication completes.
messages:
AuthRequest:
$ref: '#/components/messages/AuthRequest'
AuthResponse:
$ref: '#/components/messages/AuthResponse'
PingRequest:
$ref: '#/components/messages/PingRequest'
PongResponse:
$ref: '#/components/messages/PongResponse'
SubscribeAllRequest:
$ref: '#/components/messages/SubscribeAllRequest'
SubscribeAllResponse:
$ref: '#/components/messages/SubscribeAllResponse'
UnsubscribeAllRequest:
$ref: '#/components/messages/UnsubscribeAllRequest'
UnsubscribeAllResponse:
$ref: '#/components/messages/UnsubscribeAllResponse'
SubscribeTraitValueRequest:
$ref: '#/components/messages/SubscribeTraitValueRequest'
SubscribeTraitValueResponse:
$ref: '#/components/messages/SubscribeTraitValueResponse'
UnsubscribeTraitValueRequest:
$ref: '#/components/messages/UnsubscribeTraitValueRequest'
UnsubscribeTraitValueResponse:
$ref: '#/components/messages/UnsubscribeTraitValueResponse'
SubscribeObjectEventRequest:
$ref: '#/components/messages/SubscribeObjectEventRequest'
SubscribeObjectEventResponse:
$ref: '#/components/messages/SubscribeObjectEventResponse'
UnsubscribeObjectEventRequest:
$ref: '#/components/messages/UnsubscribeObjectEventRequest'
UnsubscribeObjectEventResponse:
$ref: '#/components/messages/UnsubscribeObjectEventResponse'
TraitValueUpdate:
$ref: '#/components/messages/TraitValueUpdate'
ObjectEvent:
$ref: '#/components/messages/ObjectEvent'
ErrorMessage:
$ref: '#/components/messages/ErrorMessage'
operations:
sendAuthRequest:
action: send
description: Used only for the Studio self-domain endpoint and LAN Studio environments; AuthRequest is not used in production or cloud environments.
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/AuthRequest'
receiveAuthResponse:
action: receive
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/AuthResponse'
- $ref: '#/channels/studioWebSocket/messages/ErrorMessage'
sendPing:
action: send
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/PingRequest'
receivePong:
action: receive
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/PongResponse'
- $ref: '#/channels/studioWebSocket/messages/ErrorMessage'
sendSubscriptionCommand:
action: send
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/SubscribeAllRequest'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeAllRequest'
- $ref: '#/channels/studioWebSocket/messages/SubscribeTraitValueRequest'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeTraitValueRequest'
- $ref: '#/channels/studioWebSocket/messages/SubscribeObjectEventRequest'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeObjectEventRequest'
receiveSubscriptionCommandResponse:
action: receive
description: |
When a subscribe or unsubscribe operation fails, the server may return ErrorMessage, or it may return the corresponding business response type with a non-zero code.
The caller should correlate requests by msgId and evaluate code consistently across all responses instead of waiting only for a fixed response type.
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/SubscribeAllResponse'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeAllResponse'
- $ref: '#/channels/studioWebSocket/messages/SubscribeTraitValueResponse'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeTraitValueResponse'
- $ref: '#/channels/studioWebSocket/messages/SubscribeObjectEventResponse'
- $ref: '#/channels/studioWebSocket/messages/UnsubscribeObjectEventResponse'
- $ref: '#/channels/studioWebSocket/messages/ErrorMessage'
receivePushMessage:
action: receive
channel:
$ref: '#/channels/studioWebSocket'
messages:
- $ref: '#/channels/studioWebSocket/messages/TraitValueUpdate'
- $ref: '#/channels/studioWebSocket/messages/ObjectEvent'
- $ref: '#/channels/studioWebSocket/messages/ErrorMessage'
components:
messages:
AuthRequest:
name: AuthRequest
title: WebSocket authentication request
summary: First-message authentication flow for the Studio self-domain endpoint and LAN Studio environments; not used in production or cloud environments.
payload:
$ref: '#/components/schemas/AuthRequestMessage'
examples:
- name: bearerToken
payload:
type: AuthRequest
version: v1
msgId: '10001'
data:
authType: token
token: '<accessToken>'
deviceUniqueId: '<deviceUniqueId>'
clientId: '<clientId>'
AuthResponse:
name: AuthResponse
title: WebSocket authentication response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/AuthResponseMessage'
examples:
- name: success
payload:
type: AuthResponse
version: v1
msgId: '10001'
data: ''
code: 0
message: Authentication successful. Welcome <username>
PingRequest:
name: ping
title: Heartbeat request
payload:
$ref: '#/components/schemas/PingRequestMessage'
examples:
- name: ping
payload:
type: ping
version: v1
msgId: '10002'
data: null
PongResponse:
name: pong
title: Heartbeat response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/PongResponseMessage'
examples:
- name: pong
payload:
type: pong
version: v1
msgId: '10002'
data: pong
code: 0
message: success
SubscribeAllRequest:
name: SubscribeAllRequest
title: Subscribe to all or selected devices request
payload:
$ref: '#/components/schemas/SubscribeAllRequestMessage'
examples:
- name: allDevices
payload:
type: SubscribeAllRequest
version: v1
msgId: '1751609244328'
data: null
- name: allDevicesWithEmptyArray
payload:
type: SubscribeAllRequest
version: v1
msgId: '1751609244329'
data: []
- name: specifiedDevices
payload:
type: SubscribeAllRequest
version: v1
msgId: '1751609244328'
data:
- deviceId
SubscribeAllResponse:
name: SubscribeAllResponse
title: Subscribe to all or selected devices response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/SubscribeAllResponseMessage'
UnsubscribeAllRequest:
name: UnsubscribeAllRequest
title: Unsubscribe from all or selected devices request
description: |
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.
payload:
$ref: '#/components/schemas/UnsubscribeAllRequestMessage'
UnsubscribeAllResponse:
name: UnsubscribeAllResponse
title: Unsubscribe from all or selected devices response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/UnsubscribeAllResponseMessage'
SubscribeTraitValueRequest:
name: SubscribeTraitValueRequest
title: Subscribe to specified Trait values request
payload:
$ref: '#/components/schemas/SubscribeTraitValueRequestMessage'
examples:
- name: subscribeTrait
payload:
type: SubscribeTraitValueRequest
version: v1
msgId: get_devices_1751609244328
data:
- deviceId: '57190441014857'
endpointId: 3
functionCode: MediaPlayback
traitCodes:
- TargetPlaybackState
SubscribeTraitValueResponse:
name: SubscribeTraitValueResponse
title: Subscribe to specified Trait values response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/SubscribeTraitValueResponseMessage'
UnsubscribeTraitValueRequest:
name: UnsubscribeTraitValueRequest
title: Unsubscribe from specified Trait values request
payload:
$ref: '#/components/schemas/UnsubscribeTraitValueRequestMessage'
UnsubscribeTraitValueResponse:
name: UnsubscribeTraitValueResponse
title: Unsubscribe from specified Trait values response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/UnsubscribeTraitValueResponseMessage'
SubscribeObjectEventRequest:
name: SubscribeObjectEventRequest
title: Subscribe to space, device-space relationship, and automation object events
summary: Incrementally adds object-event subscriptions for the current WebSocket session; duplicate subscriptions are idempotent.
description: |
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.
payload:
$ref: '#/components/schemas/SubscribeObjectEventRequestMessage'
examples:
- name: subscribeAllPreciseObjectEvents
payload:
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: []
- name: subscribeSelectedObjects
payload:
type: SubscribeObjectEventRequest
version: v1
msgId: object-subscribe-2
data:
- eventTypes:
- DEVICE_SPACE_UPDATED
objectIds:
- device-1
- device-2
- eventTypes:
- AUTOMATION_REMOVED
- AUTOMATION_UPDATED
- AUTOMATION_SPACE_UPDATED
objectIds:
- automation-1
SubscribeObjectEventResponse:
name: SubscribeObjectEventResponse
title: Object-event subscription response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/SubscribeObjectEventResponseMessage'
UnsubscribeObjectEventRequest:
name: UnsubscribeObjectEventRequest
title: Unsubscribe from space, device-space relationship, and automation object events
summary: Removes specified object rules or clears specified event types for the current WebSocket session.
description: |
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.
payload:
$ref: '#/components/schemas/UnsubscribeObjectEventRequestMessage'
examples:
- name: unsubscribeSelectedObject
payload:
type: UnsubscribeObjectEventRequest
version: v1
msgId: object-unsubscribe-1
data:
- eventTypes:
- AUTOMATION_UPDATED
objectIds:
- automation-1
- name: clearEventType
payload:
type: UnsubscribeObjectEventRequest
version: v1
msgId: object-unsubscribe-2
data:
- eventTypes:
- AUTOMATION_UPDATED
objectIds: []
UnsubscribeObjectEventResponse:
name: UnsubscribeObjectEventResponse
title: Object-event unsubscription response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/UnsubscribeObjectEventResponseMessage'
TraitValueUpdate:
name: TraitValueUpdate
title: Trait value change push
payload:
$ref: '#/components/schemas/PushTraitValueUpdateMessageV1'
examples:
- name: traitValueUpdate
payload:
type: TraitValueUpdate
version: v1
msgId: '1754469720110'
data:
- deviceId: '57190441014857'
endpointId: 3
functionCode: MediaPlayback
traitCode: TargetPlaybackState
value: '0'
time: 1754469720110
code: 0
message: ''
- name: deviceNameUpdated
payload:
type: TraitValueUpdate
version: v1
msgId: '1789113600000'
data:
- deviceId: device-1
endpointId: 0
functionCode: EndpointLabel
traitCode: EndpointName
value: Living Room Light
time: 1789113600000
code: 0
message: ''
ObjectEvent:
name: objectEvent
title: Object event push
summary: Device add/remove events are pushed by default; changes to spaces, automations, and space relationships are delivered according to precise object subscriptions.
description: |
DEVICE_ADDED and DEVICE_REMOVED are pushed by default after an authenticated connection is established.
SPACE_*, AUTOMATION_*, and DEVICE_SPACE_UPDATED 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.
Standalone scenes are managed via /scenes, and change notifications continue to use the AUTOMATION_* event family; object classification should follow the query results of /automations and /scenes. No standalone events are provided for changes in count.
Scenes are represented by the `manualTriggers` inside an automation; no standalone scene event is provided, and changes in count do not produce separate events.
The protocol does not provide a globally unique event ID; the push `msgId` is only for link tracing. Callers should process events idempotently according to object state rather than deduplicating only by `objectId`, `eventType`, and `time`.
payload:
$ref: '#/components/schemas/PushObjectEventMessageV1'
examples:
- name: deviceAdded
payload:
type: objectEvent
version: v1
msgId: '2'
data:
eventType: DEVICE_ADDED
objectId: 14d3b91
time: 1754469720110
data:
deviceId: 14d3b91
name: ''
deviceTypesList:
- Light
endpointIds:
- 0
- 2
- 3
time: 1754469720110
code: 0
message: success
- name: deviceSpaceUpdated
payload:
type: objectEvent
version: v1
msgId: object-event-1
data:
eventType: DEVICE_SPACE_UPDATED
objectId: device-1
time: 1789113600000
data:
deviceId: device-1
oldSpaceId: space-1
space:
spaceId: space-2
name: Bedroom
spatialMarking: room
parentSpaceId: home-1
code: 0
message: success
- name: automationUpdated
payload:
type: objectEvent
version: v1
msgId: object-event-2
data:
eventType: AUTOMATION_UPDATED
objectId: automation-1
time: 1789113600000
data:
automationId: automation-1
definitionType: WHEN_IF_THEN
name: Home Mode
enabled: true
createTime: 1789000000000
code: 0
message: success
- name: automationSpaceUnassigned
payload:
type: objectEvent
version: v1
msgId: object-event-3
data:
eventType: AUTOMATION_SPACE_UPDATED
objectId: automation-1
time: 1789113600000
data:
automationId: automation-1
oldSpaceId: space-2
space: null
code: 0
message: success
ErrorMessage:
name: ErrorMessage
title: Error response
correlationId:
location: $message.payload#/msgId
payload:
$ref: '#/components/schemas/ErrorMessageV1'
examples:
- name: missingMsgId
payload:
type: ErrorMessage
version: v1
msgId: ''
data: null
code: 400
message: Missing msgId
schemas:
MessageType:
type: string
description: Message types used by this protocol and shared push schemas; actual available messages are determined by the corresponding channel and operation.
enum:
- AuthRequest
- AuthResponse
- ping
- pong
- SubscribeAllRequest
- SubscribeAllResponse
- UnsubscribeAllRequest
- UnsubscribeAllResponse
- SubscribeTraitValueRequest
- SubscribeTraitValueResponse
- UnsubscribeTraitValueRequest
- UnsubscribeTraitValueResponse
- SubscribeObjectEventRequest
- SubscribeObjectEventResponse
- UnsubscribeObjectEventRequest
- UnsubscribeObjectEventResponse
- TraitValueUpdate
- objectEvent
- AlarmEvent
- ErrorMessage
PushAlarmEventMessageV1:
description: Shared raw alarm-push schema. It only defines the payload body and does not add alarm-subscription operations to the WebSocket channel in this document. HTTP push reuses this schema and does not use the app notification payload.
allOf:
- $ref: '#/components/schemas/BasePushMessage'
- type: object
properties:
type:
type: string
enum: [AlarmEvent]
data:
$ref: '#/components/schemas/AlarmEventDataV1'
AlarmEventDataV1:
type: object
required: [uuid, deviceName, deviceId, devicePointName, alarmClass, alarmRuleName, alarmText, alarmValue, sourceState, alarmTime, localized]
properties:
uuid: {type: string}
deviceName: {type: string}
deviceId: {type: string}
devicePointName: {type: string}
alarmClass: {type: string}
alarmRuleName: {type: string}
alarmText: {type: string}
alarmValue: {type: string}
sourceState: {type: string}
alarmTime: {type: integer, format: int64, description: Unix timestamp in milliseconds}
localized:
type: object
minProperties: 1
description: Provides 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.
additionalProperties:
type: object
required: [devicePointName, alarmText, alarmValue, sourceStateText]
properties:
devicePointName: {type: string}
alarmText: {type: string}
alarmValue: {type: string}
sourceStateText: {type: string}
MsgId:
type: string
description: A 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.
minLength: 1
maxLength: 64
ErrorMsgId:
type: string
description: Returns 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.
minLength: 0
maxLength: 64
Version:
type: string
enum:
- v1
BaseRequest:
type: object
required:
- type
- version
- msgId
properties:
type:
$ref: '#/components/schemas/MessageType'
version:
$ref: '#/components/schemas/Version'
msgId:
$ref: '#/components/schemas/MsgId'
data:
description: Business parameters.
BaseResponse:
type: object
required:
- type
- version
- msgId
- code
- message
properties:
type:
$ref: '#/components/schemas/MessageType'
version:
$ref: '#/components/schemas/Version'
msgId:
$ref: '#/components/schemas/MsgId'
data:
description: Response data. When no data is returned, it is usually an empty string or null.
code:
type: integer
format: int32
description: Processing result code. 0 indicates success, and any non-zero value indicates failure.
message:
type:
- string
- 'null'
description: Processing result message.
BasePushMessage:
type: object
required:
- type
- version
- msgId
- data
- code
- message
properties:
type:
$ref: '#/components/schemas/MessageType'
version:
$ref: '#/components/schemas/Version'
msgId:
$ref: '#/components/schemas/MsgId'
data:
description: Push payload data.
code:
type: integer
format: int32
description: Processing result code. 0 indicates success, and any non-zero value indicates failure.
message:
type:
- string
- 'null'
description: Processing result message.
AuthRequestMessage:
allOf:
- $ref: '#/components/schemas/BaseRequest'
- type: object
required:
- data
properties:
type:
type: string
enum:
- AuthRequest
data:
$ref: '#/components/schemas/AuthRequestData'
AuthRequestData:
type: object
required:
- token
properties:
authType:
type: string
description: Authentication type. Pass `token`.
enum:
- token
default: token
token:
type: string
description: "Use the format `Bearer <Token>`, where `<Token>` is the raw token obtained from Aqara Studio. Do not log or expose this token."
CommonEmptyResponse:
allOf:
- $ref: '#/components/schemas/BaseResponse'
- type: object
required:
- data
properties:
data:
type:
- string
- 'null'
default: ''
AuthResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- AuthResponse
SubscribeAllResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- SubscribeAllResponse
UnsubscribeAllResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- UnsubscribeAllResponse
SubscribeTraitValueResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- SubscribeTraitValueResponse
UnsubscribeTraitValueResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- UnsubscribeTraitValueResponse
SubscribeObjectEventResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- SubscribeObjectEventResponse
UnsubscribeObjectEventResponseMessage:
allOf:
- $ref: '#/components/schemas/CommonEmptyResponse'
- type: object
properties:
type:
type: string
enum:
- UnsubscribeObjectEventResponse
PingRequestMessage:
allOf:
- $ref: '#/components/schemas/BaseRequest'
- type: object
properties:
type:
type: string
enum:
- ping
data:
type:
- string
- 'null'
default: null
PongResponseMessage:
allOf:
- $ref: '#/components/schemas/BaseResponse'
- type: object
required:
- data
properties:
type:
type: string
enum:
- pong
data:
type: string
enum:
- pong
SubscribeAllRequestMessage:
allOf:
- $ref: '#/components/schemas/BaseRequest'
- type: object
properties:
type:
type: string
enum:
- SubscribeAllRequest
data:
type:
- array
- 'null'
default: null
description: |
List 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.
items:
type: string
UnsubscribeAllRequestMessage:
allOf:
- $ref: '#/components/schemas/BaseRequest'
- type: object
# --- truncated at 32 KB (50 KB total) ---
# Full source: https://artifacts.apis.io/aqara/asyncapi/data-export-api-en.yaml
Work with this as data
Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for asyncapi
4 MCP tools reach this
find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
curl "https://apis.io/api/v1/asyncapis/data-export-api-en"
curl "https://apis.io/api/v1/asyncapis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.