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:dataStreamNameis missing or exceeds 128 characters;dataTypeis missing or not one of the supported values; ordisplayName(200),description(500), orunitDisplay(50) exceeds its maximum length.403 Forbidden: The device identified bydeviceIddoes not belong to the caller's organization.404 Not Found: No device with the givendeviceIdexists.409 Conflict: A data stream with the same name already exists on this device.503 Service Unavailable: The device lookup used to validatedeviceIddid not respond in time.
Security
- This API requires authentication.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 503
Data stream created successfully. The stream is user-managed (managedBy = User) with no dataSource; bind a source later via the source-linking APIs.
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.
The request is missing a bearer token, or the token is malformed, expired, or otherwise fails signature/issuer validation.
The device identified by deviceId does not belong to the caller's organization.
No device with the given deviceId exists.
A data stream with the same name already exists on this device.
The device lookup used to validate deviceId did not respond in time.