Skip to main content

Compare device sleep status with ingest logs

MethodPath
GET/v1/slim/device/live/cloudwatch/:deviceId

Authentication · Access policies

Computes a Sleepiz device's away, awake or asleep status from the raw readings in the ingest logs, and compares it with the status the live telemetry shows. Use it to check whether the live status is in sync.

Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:read, Observation:search and Observation:read. Scope: the device must be visible to your token and belong to the caller's project or one of its sub-projects.

Behaviour​

  • deviceId is the device serial, letters, digits, _ and - only.
  • Only readings from the last 12 hours are read, at most 1000 log entries, newest first.
  • status is disconnected when no presence or sleep reading is found in that window.
  • presence and sleep hold the latest reading of each kind with its original Observation, or null.
  • comparison sets the log status beside the live telemetry status. statusChangeLatencyMs is set when both agree, and stalenessMs when they differ.
  • When the live status cannot be read, comparison.telemetryError holds the reason and the rest of the response is still returned.
  • Read-only.

Example​

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device/live/cloudwatch/3001000' \
-H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response​

200 — Sleep status from the ingest logs, compared with the live telemetry.

Errors​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Device:read, Observation:search or Observation:read, your session has no project, or no device with this serial is visible in your project.
422deviceId contains characters other than letters, digits, _ and -.