跳至主要内容

Create a data stream

POST 

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

Create a new data stream for a specific device.

Parameters

  • deviceId (string, required): Unique ID of the device. Example: 74fe488d5d35

Request Body

  • dataStreamName (string, required): Unique name of the data stream within the device.
  • displayName (string, optional): Human-readable label for the data stream.
  • description (string, optional): Description of the data stream.
  • unitDisplay (string, optional): Display unit of the measured value (e.g. °C, %).
  • dataType (string, required): Data type of the stream value (e.g. double, boolean, integer, data-pack, blob).
  • recordToDataLake (boolean, optional): Whether to persist values to the data lake.

Responses

  • 201 Created: Data stream created successfully. The stream is user-managed (managedBy = User) with no dataSource; bind a source later via the source-linking APIs.
  • 400 Bad Request: dataStreamName is missing or exceeds 128 characters; dataType is missing or not one of the supported values; or displayName (200), description (500), or unitDisplay (50) exceeds its maximum length.
  • 403 Forbidden: The device identified by deviceId does not belong to the caller's organization.
  • 404 Not Found: No device with the given deviceId exists.
  • 409 Conflict: A data stream with the same name already exists on this device.
  • 503 Service Unavailable: The device lookup used to validate deviceId did not respond in time.

Security

  • This API requires authentication.

Request​

Responses​

Data stream created successfully. The stream is user-managed (managedBy = User) with no dataSource; bind a source later via the source-linking APIs.