跳至主要内容

DataStreams

Data Engine Pipeline

Device → DataStream (managedBy: System) → Analyzer (optional) → DataStream (managedBy: User) → Alert Policy / Bridge

Overview

A DataStream is the queryable, time-series data unit that all WEDA features build on. Every device sensor is automatically synced into a System-managed DataStream with no configuration required. Additional Output DataStreams can be derived from existing DataStreams using an Analyzer. Whether device-originated or an Analyzer output, it's the same entity: a named, typed record optionally persisted to the database.

Every downstream feature — Alert Policies and Data Stream Bridge — reads exclusively from DataStreams.

System-managed DataStream identity/lineage is read-only — managed by the auto-sync process. To derive additional DataStreams, use the Analyzers API. To create a DataStream directly (e.g. as a future Analyzer output), use POST .../data-streams.


Operations

OperationAPIDescription
List DataStreamsGET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streamsAll DataStream definitions for a device
Create DataStreamPOST /api/v1/orgs/{orgId}/devices/{deviceId}/data-streamsCreate a User-managed DataStream
Get DataStreamGET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}One definition by ID
Update DataStreamPUT /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}Replace the definition
Patch DataStreamPATCH /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}Update display fields only
Delete DataStreamDELETE /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}Remove a User-managed, unattached DataStream
Get Latest Values (all)GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/values/latestLatest snapshot for all DataStreams
Get Latest Value (one)GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/values/latestLatest value for one DataStream
Get Historical ValuesGET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/values/historicalTime-series from the database
Download BlobGET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/blobs/{blobKey}Binary value (image, waveform, etc.)

DataStream Definition

GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams

Returns a paginated list. Filter by managedBy (System/User). Each item includes dataStreamId, dataStreamName, displayName, dataType, recordToDataLake, managedBy, and dataSource (null if unbound).

Use the dataStreamId returned by the current definition when querying values.

Create a DataStream

POST /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams

Required: dataStreamName (unique per device), dataType (double/boolean/integer/string). Optional: displayName, description, unitDisplay, recordToDataLake (default true). A created DataStream is always managedBy: User with dataSource: null until an Analyzer claims it as an output.


Reading Values

Get Latest Values (All DataStreams)

GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/values/latest

Returns the most recent value snapshot for every DataStream on the device within the system-defined retention period, currently 60 minutes. Returns 204 No Content if no value is available.

Get Latest Value (Single DataStream)

GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/values/latest

Same retention window, scoped to one DataStream.

Get Historical Values (Time Series)

GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/values/historical

Cursor-based pagination over data stored in the database. Requires start/end; use the returned nextCursor while hasMore is true.

recordToDataLake gates history

Historical queries only return data for DataStreams with recordToDataLake: true. Calling this endpoint on a recordToDataLake: false DataStream returns an empty result, not an error — there is no history to query, by design.

Download Binary Data (Blob)

GET /api/v1/orgs/{orgId}/devices/{deviceId}/data-streams/{dataStreamId}/blobs/{blobKey}

Retrieves a binary value (e.g. image, waveform buffer) stored under a specific blob key.


Scenario

A developer wants a calibrated Celsius reading from a factory device's 4–20 mA analog input. The raw signal is a System-managed DataStream (AI_0); an Analyzer converts it to an Output DataStream (temperature_c), which the developer then queries directly — this walks through discovery, Analyzer setup, and reading the computed value end to end:

The list endpoint has no name filter — managedBy, sorting, skipCount, and maxResultCount are the only supported query parameters, so match on dataStreamName yourself in the returned list.


Constraints

  • System-managed DataStream identity/lineage fields are read-only — managed by the auto-sync process
  • recordToDataLake: false DataStreams have no historical data — by design, not an error
  • Use the dataStreamId returned by the current definition when querying values
  • Deleting an Analyzer does not release its output DataStream's claim — see Analyzers
  • A User-managed DataStream can only be deleted if it is unattached: not system-managed, not claimed as an Analyzer output, and not referenced by an Alert Policy

Last updated on Aug-1, 2026 | Version 1.1.1