# DataStreams

Device datastream operations

## Get device datastream values

> Retrieve current values for datastreams of a device using datastream IDs\
> \
> Required permissions, when user-scoped authentication is used: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can read datastreams only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamValue":{"type":"object","properties":{"dataStreamId":{"type":"integer","format":"int32","description":"DataStream ID"},"pin":{"type":"string","description":"DataStream pin"},"dataStreamLabel":{"type":"string","description":"DataStream label"},"dataStreamAlias":{"type":"string","description":"DataStream alias"},"value":{"$ref":"#/components/schemas/DataStreamRawValue"},"updatedAt":{"type":"integer","format":"int64","description":"Last update timestamp"}},"required":["dataStreamId","pin","dataStreamLabel","dataStreamAlias"]},"DataStreamRawValue":{"oneOf":[{"type":"string","description":"String datastream value"},{"type":"number","format":"double","description":"Double, integer or enum datastream value"},{"type":"array","description":"Location datastream value. Represented as an array of two elements, where the first is longitude, and the second is latitude.","items":{"type":"number","format":"double"},"minItems":2,"maxItems":2}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v2/organization/device/datastreams":{"get":{"tags":["DataStreams"],"summary":"Get device datastream values","description":"Retrieve current values for datastreams of a device using datastream IDs\n\nRequired permissions, when user-scoped authentication is used: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can read datastreams only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"getDeviceDataStreamsV2","parameters":[{"name":"deviceId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Device ID"},{"name":"dataStreamIds","in":"query","schema":{"type":"array","items":{"type":"integer","format":"int32"}},"description":"Optional list of datastream IDs to filter results","style":"form","explode":true}],"responses":{"200":{"description":"Datastream values","content":{"application/json":{"schema":{"type":"object","properties":{"dataStreams":{"type":"array","items":{"$ref":"#/components/schemas/DataStreamValue"}}}}}}},"403":{"description":"Forbidden"},"404":{"description":"Device not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get datastreams values for multiple devices

> Retrieve current values for datastreams across multiple devices in batch.\
> Maximum of 10 devices per request.\
> \
> If any device is not found or you don't have access to it, the device will be ignored.\
> \
> Required permissions, when user-scoped authentication is used: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens return data only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted; inaccessible devices are skipped.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamValue":{"type":"object","properties":{"dataStreamId":{"type":"integer","format":"int32","description":"DataStream ID"},"pin":{"type":"string","description":"DataStream pin"},"dataStreamLabel":{"type":"string","description":"DataStream label"},"dataStreamAlias":{"type":"string","description":"DataStream alias"},"value":{"$ref":"#/components/schemas/DataStreamRawValue"},"updatedAt":{"type":"integer","format":"int64","description":"Last update timestamp"}},"required":["dataStreamId","pin","dataStreamLabel","dataStreamAlias"]},"DataStreamRawValue":{"oneOf":[{"type":"string","description":"String datastream value"},{"type":"number","format":"double","description":"Double, integer or enum datastream value"},{"type":"array","description":"Location datastream value. Represented as an array of two elements, where the first is longitude, and the second is latitude.","items":{"type":"number","format":"double"},"minItems":2,"maxItems":2}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/datastreams/batch":{"get":{"tags":["DataStreams"],"summary":"Get datastreams values for multiple devices","description":"Retrieve current values for datastreams across multiple devices in batch.\nMaximum of 10 devices per request.\n\nIf any device is not found or you don't have access to it, the device will be ignored.\n\nRequired permissions, when user-scoped authentication is used: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens return data only for owned devices unless `ORG_DEVICES_VIEW` is granted; inaccessible devices are skipped.\n","operationId":"getBatchDeviceDataStreams","parameters":[{"name":"deviceIds","in":"query","required":true,"schema":{"type":"array","items":{"type":"integer","format":"int32"},"maxItems":10},"description":"List of device IDs","style":"form","explode":true},{"name":"dataStreamIds","in":"query","schema":{"type":"array","items":{"type":"integer","format":"int32"}},"description":"Optional list of datastream IDs to filter results","style":"form","explode":true}],"responses":{"200":{"description":"Batch datastream values","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"integer","format":"int32"},"dataStreams":{"type":"array","items":{"$ref":"#/components/schemas/DataStreamValue"}}},"required":["deviceId","dataStreams"]}}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get datastream history

> Retrieve historical data for a specific datastream\
> \
> Required permissions, when user-scoped authentication is used: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can read history only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/datastream/history":{"get":{"tags":["DataStreams"],"summary":"Get datastream history","description":"Retrieve historical data for a specific datastream\n\nRequired permissions, when user-scoped authentication is used: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can read history only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"getDeviceDataStreamHistory","parameters":[{"name":"deviceId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Device ID"},{"name":"dataStreamId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"DataStream ID (alternative to pin)"},{"name":"from","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"description":"Start timestamp (Unix epoch milliseconds)"},{"name":"to","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"description":"End timestamp (Unix epoch milliseconds)"},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":0,"minimum":0},"description":"Page number (0-indexed)"},{"name":"size","in":"query","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":1000},"description":"Page size (max 1000)"}],"responses":{"200":{"description":"Historical data","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","properties":{"value":{"type":"number","format":"double","description":"Datastream value (number representation)"},"createdAt":{"type":"integer","format":"int64","description":"Timestamp of the data point in milliseconds since epoch"}},"required":["value","createdAt"]}},"totalElements":{"type":"integer","format":"int64"}},"required":["content","totalElements"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Device/datastream not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update single datastream value

> Update the value of a specific datastream\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_DEVICES\_CONTROL\`.\
> Required device view permission: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can update datastreams only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamRawValue":{"oneOf":[{"type":"string","description":"String datastream value"},{"type":"number","format":"double","description":"Double, integer or enum datastream value"},{"type":"array","description":"Location datastream value. Represented as an array of two elements, where the first is longitude, and the second is latitude.","items":{"type":"number","format":"double"},"minItems":2,"maxItems":2}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/datastream":{"post":{"tags":["DataStreams"],"summary":"Update single datastream value","description":"Update the value of a specific datastream\n\nRequired permissions, when user-scoped authentication is used: `ORG_DEVICES_CONTROL`.\nRequired device view permission: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can update datastreams only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"updateDeviceDataStream","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"integer","format":"int32","description":"Device ID"},"dataStreamId":{"type":"integer","format":"int32","description":"DataStream ID"},"value":{"$ref":"#/components/schemas/DataStreamRawValue"}},"required":["deviceId","dataStreamId","value"]}}}},"responses":{"204":{"description":"Datastream updated successfully"},"400":{"description":"Bad request - Invalid value","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Device/datastream not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update multiple datastream values

> Update values for multiple datastreams of a single device.\
> \
> Invalid datastream IDs or values with mismatched types are silently skipped (no error is returned for individual entries).\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_DEVICES\_CONTROL\`.\
> Required device view permission: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can update datastreams only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamRawValue":{"oneOf":[{"type":"string","description":"String datastream value"},{"type":"number","format":"double","description":"Double, integer or enum datastream value"},{"type":"array","description":"Location datastream value. Represented as an array of two elements, where the first is longitude, and the second is latitude.","items":{"type":"number","format":"double"},"minItems":2,"maxItems":2}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/datastreams":{"post":{"tags":["DataStreams"],"summary":"Update multiple datastream values","description":"Update values for multiple datastreams of a single device.\n\nInvalid datastream IDs or values with mismatched types are silently skipped (no error is returned for individual entries).\n\nRequired permissions, when user-scoped authentication is used: `ORG_DEVICES_CONTROL`.\nRequired device view permission: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can update datastreams only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"updateMultipleDeviceDataStreams","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"integer","format":"int32","description":"Device ID"},"values":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DataStreamRawValue"},"description":"Map of dataStreamId to value"}},"required":["deviceId","values"]}}}},"responses":{"204":{"description":"Datastreams updated successfully"},"400":{"description":"Bad request - Invalid values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Device not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Batch update datastream values for multiple devices

> Update datastream values for multiple devices in a single request.\
> The product is automatically derived from the first valid device in the batch.\
> All devices must belong to the same product (validated via original product ID to support sub-products/variants).\
> \
> The \`fields\` array defines the column schema: the first element must be \`"deviceId"\`,\
> followed by datastream labels (e.g., \`"Temperature"\`, \`"Humidity"\`).\
> Each entry in \`updates\` is an array matching the \`fields\` schema.\
> Use \`null\` to skip a datastream for a given device.\
> \
> Maximum of 10,000 updates per request.\
> \
> When all rows succeed, the endpoint returns \`204 No Content\`.\
> When some rows are skipped (invalid device, no access, wrong product, etc.),\
> the endpoint returns \`200 OK\` with a JSON body reporting either:\
> \- \*\*Counter mode\*\* (default): generic counters per error category\
> \- \*\*Debug mode\*\* (\`"debug": true\`): detailed per-row skip reasons (at most 100)\
> \
> When no valid device is found to derive the product, the endpoint returns \`400 Bad Request\`.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_DEVICES\_CONTROL\`.\
> Required device view permission: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can update datastreams only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/product/devices/batch-update":{"post":{"tags":["DataStreams"],"summary":"Batch update datastream values for multiple devices","description":"Update datastream values for multiple devices in a single request.\nThe product is automatically derived from the first valid device in the batch.\nAll devices must belong to the same product (validated via original product ID to support sub-products/variants).\n\nThe `fields` array defines the column schema: the first element must be `\"deviceId\"`,\nfollowed by datastream labels (e.g., `\"Temperature\"`, `\"Humidity\"`).\nEach entry in `updates` is an array matching the `fields` schema.\nUse `null` to skip a datastream for a given device.\n\nMaximum of 10,000 updates per request.\n\nWhen all rows succeed, the endpoint returns `204 No Content`.\nWhen some rows are skipped (invalid device, no access, wrong product, etc.),\nthe endpoint returns `200 OK` with a JSON body reporting either:\n- **Counter mode** (default): generic counters per error category\n- **Debug mode** (`\"debug\": true`): detailed per-row skip reasons (at most 100)\n\nWhen no valid device is found to derive the product, the endpoint returns `400 Bad Request`.\n\nRequired permissions, when user-scoped authentication is used: `ORG_DEVICES_CONTROL`.\nRequired device view permission: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can update datastreams only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"batchUpdateDeviceDataStreams","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","minItems":2,"items":{"type":"string"},"description":"Column schema. The first element must be `\"deviceId\"`.\nRemaining elements are datastream labels to update.\n"},"updates":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"array","items":{}},"description":"List of update rows. Each row must have the same number of elements as `fields`.\nThe first element is the device ID (integer).\nRemaining elements are the values for the corresponding datastream labels.\nUse `null` to skip updating a datastream for that device.\n"},"debug":{"type":"boolean","default":false,"description":"When `true`, the response includes detailed per-row skip reasons (max 100).\nWhen `false` (default), the response includes only generic error counters.\n"}},"required":["fields","updates"]}}}},"responses":{"200":{"description":"Partial success — some rows were skipped","content":{"application/json":{"schema":{"type":"object","properties":{"skippedRows":{"type":"array","items":{"type":"string"},"description":"Detailed per-row skip reasons (only when `debug` is `true`, max 100)"},"invalidRowSize":{"type":"integer","description":"Number of rows with incorrect array length (counter mode)"},"nullDeviceId":{"type":"integer","description":"Number of rows with null deviceId (counter mode)"},"nonNumericDeviceId":{"type":"integer","description":"Number of rows with non-numeric deviceId (counter mode)"},"deviceNotFound":{"type":"integer","description":"Number of rows where device was not found or no org access (counter mode)"},"noAccessToDevice":{"type":"integer","description":"Number of rows where per-device access check failed (counter mode)"},"wrongProduct":{"type":"integer","description":"Number of rows where device belongs to a different product (counter mode)"}}}}}},"204":{"description":"All datastreams updated successfully"},"400":{"description":"Bad request — invalid fields or no valid device found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Import batch data

> Import historical data for device in batch.\
> \
> A per-device rate limit applies to import operations.\
> Data points with timestamps more than 1 month in the future are silently skipped.\
> Maximum of 10,000 data points per request.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_DEVICE\_DATA\_IMPORT\`.\
> Required device view permission: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can import data only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamRawValue":{"oneOf":[{"type":"string","description":"String datastream value"},{"type":"number","format":"double","description":"Double, integer or enum datastream value"},{"type":"array","description":"Location datastream value. Represented as an array of two elements, where the first is longitude, and the second is latitude.","items":{"type":"number","format":"double"},"minItems":2,"maxItems":2}]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/import/batch":{"post":{"tags":["DataStreams"],"summary":"Import batch data","description":"Import historical data for device in batch.\n\nA per-device rate limit applies to import operations.\nData points with timestamps more than 1 month in the future are silently skipped.\nMaximum of 10,000 data points per request.\n\nRequired permissions, when user-scoped authentication is used: `ORG_DEVICE_DATA_IMPORT`.\nRequired device view permission: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can import data only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"importDeviceBatchData","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"integer","format":"int32","description":"Device ID"},"dataStreamId":{"type":"integer","format":"int32","description":"DataStream ID"},"values":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/DataStreamRawValue"},"ts":{"type":"integer","format":"int64","description":"Timestamp of the data point in milliseconds since epoch"}},"required":["value","ts"]}}},"required":["deviceId","dataStreamId","values"]}}}},"responses":{"204":{"description":"Import accepted and processing asynchronously"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Device not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update datastream widget property

> Update a widget property for a datastream (label, color, min, max, etc.).\
> \
> The \`value\` must be in the correct format for the given property. Returns 400 if the format is invalid.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_DEVICES\_CONTROL\`.\
> Required device view permission: \`OWN\_DEVICES\_VIEW\` or \`ORG\_DEVICES\_VIEW\`.\
> User-scoped tokens can update properties only for owned devices unless \`ORG\_DEVICES\_VIEW\` is granted.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"DataStreams","description":"Device datastream operations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"DataStreamPropertyName":{"type":"string","enum":["label","color","onBackColor","offBackColor","onColor","offColor","onLabel","offLabel","labels","min","max","isOnPlay","url","urls","step","valueFormatting","suffix","maximumFractionDigits","opacity","scale","rotation","sortType","isDisabled","isHidden","icons","onImageUrl","offImageUrl","page","sound","isMuted","loop","autoplay","contentDesign","backColor"],"description":"Widget property to update"},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/device/datastream/property":{"post":{"tags":["DataStreams"],"summary":"Update datastream widget property","description":"Update a widget property for a datastream (label, color, min, max, etc.).\n\nThe `value` must be in the correct format for the given property. Returns 400 if the format is invalid.\n\nRequired permissions, when user-scoped authentication is used: `ORG_DEVICES_CONTROL`.\nRequired device view permission: `OWN_DEVICES_VIEW` or `ORG_DEVICES_VIEW`.\nUser-scoped tokens can update properties only for owned devices unless `ORG_DEVICES_VIEW` is granted.\n","operationId":"updateDeviceDataStreamProperty","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"integer","format":"int32","description":"Device ID"},"dataStreamId":{"type":"integer","format":"int32","description":"DataStream ID"},"property":{"$ref":"#/components/schemas/DataStreamPropertyName"},"value":{"type":"string","description":"New property value","maxLength":200}},"required":["deviceId","dataStreamId","property","value"]}}}},"responses":{"204":{"description":"Property updated successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Device/datastream/property not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blynk.io/en/blynk.cloud/platform-https-api/datastreams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
