> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atomscale.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingest Chunk

> Ingest a single chunk of time series data for one channel

Uploads a chunk of time series data for a single channel. Uses `chunk_index` to compute deterministic array positions, making the operation idempotent: retrying the same `(data_id, channel_name, chunk_index)` combination replaces the same slice rather than appending.

**data\_id** `string` *required*

Data ID returned from stream initialization

**chunk\_index** `integer` *required*

Zero-based chunk index for ordering. Must be >= 0.

**channel\_name** `string` *required*

Name of the data channel (e.g., `thickness`, `temperature`). Must be 1-255 characters.

**timestamps** `array` *required*

Array of Unix epoch timestamps in seconds

**values** `array` *required*

Array of measured values corresponding to each timestamp

**units** `string`

Units for the values (e.g., `nm`, `C`)

## Response

**data\_id** `string`

The data ID for this stream

**channel\_name** `string`

The channel name that was updated

**chunk\_index** `integer`

The chunk index that was ingested

**total\_points** `integer`

Total number of data points now stored for this channel

```python SDK theme={null}
from atomscale.streaming import TimeseriesStreamer

streamer = TimeseriesStreamer(api_key="YOUR_API_KEY", points_per_chunk=100)
streamer.push(
    data_id="d290f1ee-6c54-4b01-90e6-d701748f0851",
    chunk_index=0,
    channel_name="thickness",
    timestamps=[1705312200.0, 1705312210.0, 1705312220.0],
    values=[0, 5.2, 10.1],
    units="nm",
)
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.atomscale.ai/tool-state/stream/chunk",
    headers={
        "X-API-KEY": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "chunk_index": 0,
        "channel_name": "thickness",
        "timestamps": [1705312200.0, 1705312210.0, 1705312220.0],
        "values": [0, 5.2, 10.1],
        "units": "nm"
    }
)
result = response.json()
```

```bash cURL theme={null}
curl -X POST "https://api.atomscale.ai/tool-state/stream/chunk" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "chunk_index": 0,
    "channel_name": "thickness",
    "timestamps": [1705312200.0, 1705312210.0, 1705312220.0],
    "values": [0, 5.2, 10.1],
    "units": "nm"
  }'
```

```json 201 theme={null}
{
  "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "channel_name": "thickness",
  "chunk_index": 0,
  "total_points": 3
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.