Skip to content

WebSocket Errors

WebSocket request errors use the same top-level reply structure as successful replies. code is the error code, message is human-readable context, and data contains optional structured recovery details.

json
{
  "type": "reply",
  "requestId": "req_relay_001",
  "code": "AUTH_SCOPE_DENIED",
  "message": "This operation requires the device:control permission. Update the API Client permissions in the Developer Console and obtain a new access token.",
  "data": {
    "requiredScope": "device:control"
  }
}

Replies do not contain success, a nested error, or a repeated topic.

Handling Rules

  • Branch on code.
  • Use message for display, logging, and troubleshooting, not as a stable enum.
  • data.requiredScope identifies the missing API Client permission. Obtain a new access token and WebSocket ticket after updating permissions.
  • data.retryAfterSeconds provides the recommended rate-limit delay in seconds.
  • One requestId receives one reply.

Common Errors

codeRecommended action
INVALID_REQUESTCheck the topic, operation, and parameters
UNKNOWN_TOPICUse a request topic listed in the current documentation
AUTH_INVALIDObtain a new access token and ticket
AUTH_SCOPE_DENIEDAdd the permission in requiredScope and authenticate again
DEVICE_NOT_FOUNDVerify that the device belongs to the account
DEVICE_OFFLINERetry after the device comes online
DEVICE_BUSYWait for the current device operation to finish, then retry with backoff
IDEMPOTENCY_CONFLICTGenerate a new idempotency key for a new operation
RATE_LIMITEDWait for retryAfterSeconds before retrying
COMMAND_REJECTEDCheck device capability, parameters, and current state
DEVICE_TIMEOUT / TIMEOUTTreat the operation as not confirmed successful
GATEWAY_UNAVAILABLERetry later with the original idempotency key
INTERNAL_ERRORRecord requestId and contact support

HTTP errors before the connection is established still use the REST envelope. See Session Errors for connection closures.

Docs buildVersion v1.3.6-20260720-180213-70
Copyright © 2026 WLTE