Skip to content

Devices and History ​

See WebSocket API for the connection, message format and common response fields.

API index

actionOperations
biz3ManageDevicegetUserDevice, getCompanyDevice, add, del, updateName, updateRelayEnable, updateDeviceOrderKey, notifyList, notifyManage, switchRecharge, getDeviceStatus
biz3GetDeviceHistorygetHistory, getEnv, makeInvisible
biz3GetDeviceBatteryRecordbatch-get, makeInvisible
biz3GetDeviceEmployeeKeysget, getLimited

biz3ManageDevice ​

Device management: list personal/company devices, add/remove devices, rename, relay enable, ordering, push-notification settings, rechargeable-battery switch, and single-device status.

getUserDevice ​

Fetch all device keys personally held by the signed-in user.

Request

No additional parameters.

json
{
  "action": "biz3ManageDevice",
  "op": "getUserDevice"
}

Response

FieldTypeDescription
opstring ("PubedUserDevice")Data arrives as pushed messages with op=PubedUserDevice (paged), not op=getUserDevice.
data.totalPagenumber (integer)Total number of pages.
data.data.pagenumber (integer, 1-based)Current page number, starting at 1.
data.data.listarray of device objectsDevices in this page; fields per device_object.

Note

The client collects pages 1..totalPage contiguously; a missing/out-of-order page or duplicate deviceUUID discards the whole snapshot. The client filters by keyLevel and model to find devices that can be added to the company (owner keys only). In the legacy app WebView (isFromApp and not AppHome) the client skips sending unless forced.

getCompanyDevice ​

Fetch all devices registered to the company; the server also subscribes this connection to their status updates.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID (from the current login info).
json
{
  "action": "biz3ManageDevice",
  "op": "getCompanyDevice",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Response

FieldTypeDescription
opstring ("PubedCompanyDevice")Data arrives as pushed messages with op=PubedCompanyDevice (paged).
data.totalPagenumber (integer)Total number of pages.
data.data.pagenumber (integer, 1-based)Current page number, starting at 1.
data.data.listarray of device objectsDevices in this page; fields per device_object (including stateInfo, orderKey).

Note

Code comment: device-status subscription is done automatically by the server on getCompanyDevice / getDeviceStatus; the client re-calls it after the WebSocket connectionId changes (reconnect) to resubscribe. Page-collection rules as for getUserDevice. The client re-fetches after successful add/del.

add ​

Register (or update) one or more device keys to the company.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
itemsarray of objectsYesArray of device-key objects. When parsed from a QR code: {secretKey (hex), keyIndex (hex), sesame2PublicKey (hex), keyLevel (number), deviceModel (string), deviceName (string), deviceUUID (string, upper-case)}; other callers pass device objects from getUserDevice/getCompanyDevice, or key objects returned by the native app.
json
{
  "action": "biz3ManageDevice",
  "op": "add",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "items": [
    {
      "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
      "deviceName": "Front door",
      "deviceModel": "sesame_5",
      "keyLevel": 0,
      "secretKey": "<hex>",
      "keyIndex": "<hex>",
      "sesame2PublicKey": "<hex>"
    }
  ]
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
messagestringFailure message; "Limit Exceeded" means the plan's device limit was reached.

Note

Device count is limited by plan (Limit Exceeded). The client re-fetches getCompanyDevice on success. AppLockAngle re-submits an existing device object with a changed deviceModel via add to sync the model, implying update semantics for existing devices (inferred from usage). The selection UI only offers owner-level keys.

del ​

Remove device keys from the company.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
itemsarray of {deviceUUID: string, subUUID: string}YesKeys to remove; each item is the device UUID and the holder's subUUID.
json
{
  "action": "biz3ManageDevice",
  "op": "del",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "items": [
    {
      "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
      "subUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  ]
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
messagestringFailure message.

Note

The client re-fetches getCompanyDevice on success. Removal does not reset the device itself; the app also turns off push for that device (notifyManage enablePush=false).

updateName ​

Rename a device on the user's key.

Request

FieldTypeRequiredDescription
obj.subUUIDstringYesCurrent user's subUUID.
obj.deviceUUIDstringYesDevice UUID.
obj.deviceNamestringYesNew name (non-empty).
json
{
  "action": "biz3ManageDevice",
  "op": "updateName",
  "obj": {
    "subUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "deviceName": "New name"
  }
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
reqContext.deviceUUIDstringEchoed device UUID; the client updates local state with it.
reqContext.deviceNamestringEchoed new name.

Note

Parameters are wrapped in obj, not top-level.

updateRelayEnable ​

Set the enable flag of each Hub3 LTE relay channel, stored in the server's hub3_status.relay_info.

Request

FieldTypeRequiredDescription
obj.deviceUUIDstringYesHub3 device UUID.
obj.enable1number (0|1)NoRelay channel 1 enable: 1=on, 0=off.
obj.enable2number (0|1)NoRelay channel 2 enable: 1=on, 0=off.
json
{
  "action": "biz3ManageDevice",
  "op": "updateRelayEnable",
  "obj": {
    "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "enable1": 1
  }
}

Response

FieldTypeDescription
successbooleanWhether it succeeded (the only caller passes no callback and reads nothing).

Note

Code comment: send only the channel being changed (enable1 or enable2). When reading, a missing stateInfo.relayInfo.enableN is treated as enabled.

updateDeviceOrderKey ​

Update a device's position in the user's device list after drag-and-drop.

Request

FieldTypeRequiredDescription
obj.subUUIDstringYessubUUID of the moved device key.
obj.deviceUUIDstringYesUUID of the moved device.
obj.prevKeystringNoorderKey of the device now before it; absent when moved to the top.
obj.nextKeystringNoorderKey of the device now after it; absent when moved to the end.
json
{
  "action": "biz3ManageDevice",
  "op": "updateDeviceOrderKey",
  "obj": {
    "subUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "prevKey": "<orderKey>",
    "nextKey": "<orderKey>"
  }
}

Response

FieldTypeDescription
successbooleanWhether it succeeded; on success the client re-fetches getCompanyDevice to get the server-generated orderKeys.

Note

Dragging is only enabled when the first device has an orderKey. orderKeys are generated by the server.

notifyList ​

Get each device's push-notification on/off state for a push token.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
pushTokenstringYesPush token supplied by the native app.
itemsunknownNoSupported by the hook, but the only caller does not pass it (undefined in practice).
json
{
  "action": "biz3ManageDevice",
  "op": "notifyList",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "pushToken": "<push-token>"
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
messagestringFailure message.
data[].deviceUUIDstringDevice UUID.
data[].deviceNamestringDevice name.
data[].enablePushbooleanWhether push is enabled for the device.

notifyManage ​

Turn push notifications for a device on or off for a push token.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
pushTokenstringYesPush token.
deviceUUIDstringYesDevice UUID.
enablePushbooleanYestrue=enable push, false=disable.
json
{
  "action": "biz3ManageDevice",
  "op": "notifyManage",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "pushToken": "<push-token>",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "enablePush": true
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
messagestringFailure message.

Note

After removing a device (del) the app calls this with enablePush=false.

switchRecharge ​

Set whether the device uses a rechargeable battery (affects battery level calculation).

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID.
isRechargeBatterynumber (0|1)Yes1=rechargeable, 0=regular battery (converted from a boolean by the client).
json
{
  "action": "biz3ManageDevice",
  "op": "switchRecharge",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "isRechargeBattery": 1
}

Response

FieldTypeDescription
successbooleanWhether it succeeded; on failure the client reverts the switch.

Note

On success the client re-fetches the device list and battery records (batch-get), suggesting records depend on this setting. The current value is read from stateInfo.isRechargeBattery.

getDeviceStatus ​

Fetch a single device's detail and status; the server also subscribes this connection to its status updates.

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID (the client does not send when empty).
json
{
  "action": "biz3ManageDevice",
  "op": "getDeviceStatus",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Response

FieldTypeDescription
dataarray of device objectsThe client takes only data[0] as the device detail (fields per device_object); an empty array means none.

Note

Code comment: status subscription is done automatically by the server on getCompanyDevice / getDeviceStatus. Used by firmware upgrade, device settings, battery pages, etc., as a fallback when the device is not in the company list.

biz3GetDeviceHistory ​

Device operation history: paged history retrieval, environment snapshot of a record, and hiding a record.

getHistory ​

Fetch paged operation history for one or more devices.

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
listarray of objectsYesQuery targets. Single-device: [{deviceUUID: string, lastKey: number|null}]; all-devices: each item is {deviceId: string, lastKey: number|null} (note the key name deviceId). lastKey is the timestamp of the last record of the previous page, null for the first page.
pageSizenumber | nullNoPage size; null by default (server default), 100 when exporting CSV/Excel.
json
{
  "action": "biz3GetDeviceHistory",
  "op": "getHistory",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "list": [
    {
      "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
      "lastKey": null
    }
  ],
  "pageSize": null
}

Response

FieldTypeDescription
dataarray of history records (single-device form)For single-device queries, an array of history records; empty means no more.
data[].device_idstringDevice UUID.
data[].timestampnumberRecord time (parsed by the client as new Date(timestamp), i.e. milliseconds); also used as the next page's lastKey.
data[].typenumberHistory event type (unlock, lock, etc.; mapped by the client to an icon and label).
data[].history_tagstring (base64) | object of byte valuesOperator tag: base64-encoded UTF-8 text (may also be an object of byte values); when absent the client shows the manual-operation label for the type.
data[].record_idnumber | stringRecord ID (used as a list key).
data[].viaunknownOperation method (referenced only as a CSV export column).
data[].botHistoryModestring ('script'|'widget'|'manual')Bot2/Bot3 history trigger mode: script, widget click, manual click.
data[].botAliasstringBot script alias (shown when botHistoryMode=script).
data[].botViaTypeunknownBot trigger-via type, passed to the display component.
data.itemsarray of history records (multi-device form)Merged history records for all-devices queries (same fields as above).
data.deviceLastKeysobject {deviceUUID: lastKey}Per-device next-page lastKey, fed back into list on the next request.
data.hasMorebooleanWhether more records exist.

Note

Response shape depends on the request: single-device (list items use deviceUUID) returns a data array; all-devices (list items use deviceId) returns data{items, deviceLastKeys, hasMore}. The code does not show how the server distinguishes the two (list length or key name); confirm with the backend. Export keeps paging while the returned count equals pageSize.

getEnv ​

Fetch the environment snapshot captured with a history record.

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID (from the record's device_id).
timestampnumberYesThe history record's timestamp.
json
{
  "action": "biz3GetDeviceHistory",
  "op": "getEnv",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "timestamp": 1700000000000
}

Response

FieldTypeDescription
dataarray of single-key objects [{key: value}, ...] | JSON stringEnvironment snapshot: an array of single-key objects, each key a metric name and value a number/string/array; may also be a JSON string. Treated as {} (no data) when missing.

Note

The client does not check success; it base64-encodes data and passes it to the snapshot page. Concrete key names are not listed in code (translated via i18n envSnapshot.<key>).

makeInvisible ​

Hide (remove from display) a history record.

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID (from the record's device_id).
timestampnumberYestimestamp of the record to hide.
json
{
  "action": "biz3GetDeviceHistory",
  "op": "makeInvisible",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "timestamp": 1700000000000
}

Response

FieldTypeDescription
successbooleanOn success the client removes the record with that timestamp from the list.

Note

The history page disables interaction for guest keys (keyLevel=2). Soft-delete semantics are inferred from the name (makeInvisible).

biz3GetDeviceBatteryRecord ​

Device battery voltage records: paged retrieval and hiding a record.

batch-get ​

Fetch paged battery voltage/percentage records of a device for the battery chart.

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID.
lastEvaluatedKeyany | nullNoPagination cursor: pass back the previous response's data.lastEvaluatedKey unchanged; null for the first page.
pageSizenumberYesPage size: 50 in the app, 100 on the web.
json
{
  "action": "biz3GetDeviceBatteryRecord",
  "op": "batch-get",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "lastEvaluatedKey": null,
  "pageSize": 100
}

Response

FieldTypeDescription
data.recordsarray of objectsBattery records (treated as empty when missing).
data.records[].tsnumberRecord time, Unix seconds.
data.records[].lightnumberLight-load voltage in mV (client divides by 1000 to show V).
data.records[].heavynumberHeavy-load voltage in mV; -1 means not available.
data.records[].lightPercentagenumberBattery percentage corresponding to the light-load voltage.
data.records[].heavyPercentagenumberBattery percentage corresponding to the heavy-load voltage.
data.lastEvaluatedKeyany | nullNext-page cursor; empty means no more data.

Note

Not called for WiFi-module models (the client shows fixed placeholder data). Each new page is prepended (older records).

makeInvisible ​

Hide a single battery record.

Request

FieldTypeRequiredDescription
deviceUUIDstringYesDevice UUID.
timestamp_secondnumberYests of the record to hide (Unix seconds).
json
{
  "action": "biz3GetDeviceBatteryRecord",
  "op": "makeInvisible",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "timestamp_second": 1700000000
}

Response

FieldTypeDescription
successbooleanWhether it succeeded.
data.timestamp_secondnumberEchoed timestamp of the hidden record; the client removes that point from the chart.

Note

Not called for WiFi-module models.

biz3GetDeviceEmployeeKeys ​

Get all key holders (employees and guest keys) of a device.

get ​

Get the full list of the device's key holders (no limit).

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
deviceUUIDstringYesDevice UUID.
limitnumber (0) | undefinedNo0 or omitted selects op=get (manage mode sends 0; other refreshes omit it).
json
{
  "action": "biz3GetDeviceEmployeeKeys",
  "op": "get",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "limit": 0
}

Response

FieldTypeDescription
dataarray of objectsList of key holders.
data[].subUUIDstringHolder's subUUID (a guest key entry itself may lack it).
data[].keyLevelnumber0=owner, 1=manager, 2=guest.
data[].startAtnumberValidity start for guest keys (keyLevel=2), Unix seconds.
data[].endAtnumberValidity end for guest keys, Unix seconds; if startAt/endAt are absent it is shown as always valid.
data[].employeeNamestringUser name; for guest keys it may be a timestamp-like name (the client formats it as month/day).
data[].employeeEmailstringUser email (optional).
data[].guestKeyIdstringGuest key ID; non-empty means the entry is a guest key.
data[].secretKeystringWhen equal to a guest key's guestKeyId, the user obtained access via that guest key (the client groups them under it).
hasMorebooleanTop-level: whether more holders exist beyond those returned.

Note

The client picks op from limit: getLimited when limit>0, otherwise get.

getLimited ​

Get the first N key holders of a device (preview on the device detail page).

Request

FieldTypeRequiredDescription
companyIDstringYesCompany ID.
deviceUUIDstringYesDevice UUID.
limitnumber (>0)YesMaximum number to return; the client sends 5 outside manage mode.
json
{
  "action": "biz3GetDeviceEmployeeKeys",
  "op": "getLimited",
  "companyID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "deviceUUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "limit": 5
}

Response

FieldTypeDescription
dataarray of objectsKey holders; same fields as op=get.
hasMorebooleanTop-level: true when more than limit exist; the client shows a "more" control.