> ## 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.

# Initialize Metrology Stream

> Initialize a new metrology time series stream

Creates a new metrology streaming session by initializing data catalogue and processed metrology catalogue entries. Returns a `data_id` to use for subsequent chunk uploads.

<ParamField body="points_per_chunk" type="integer" required>
  Number of points per chunk (fixed for the duration of the stream). Must be greater than 0.
</ParamField>

<ParamField body="stream_name" type="string">
  Human-readable name for the stream
</ParamField>

<ParamField body="synth_source_id" type="integer">
  Growth instrument ID to link. Must belong to your organization.
</ParamField>

<ParamField body="physical_sample_id" type="string">
  UUID of an existing physical sample to associate with this stream
</ParamField>

<ParamField body="project_id" type="string">
  UUID of a project to associate with this stream
</ParamField>

## Response

<ResponseField name="data_id" type="string" required>
  UUID for the newly created stream. Use this ID for subsequent chunk uploads and finalization.
</ResponseField>

<ResponseField name="processed_data_id" type="string">
  UUID for the processed data entry
</ResponseField>

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

  streamer = TimeseriesStreamer(api_key="YOUR_API_KEY", points_per_chunk=100)
  data_id = streamer.initialize(
      stream_name="MBE Run 2024-01-15 Thickness Monitor",
      physical_sample="GaN-001",
      project_id="d290f1ee-6c54-4b01-90e6-d701748f0851",
  )
  ```

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

  response = requests.post(
      "https://api.atomscale.ai/metrology/stream/initialize",
      headers={
          "X-API-KEY": "YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "stream_name": "MBE Run 2024-01-15 Thickness Monitor",
          "points_per_chunk": 100,
          "project_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
          "physical_sample_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
      }
  )
  result = response.json()
  data_id = result["data_id"]
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.atomscale.ai/metrology/stream/initialize" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "stream_name": "MBE Run 2024-01-15 Thickness Monitor",
      "points_per_chunk": 100,
      "project_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "physical_sample_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "processed_data_id": "e3a1b2c3-4567-89ab-cdef-234567890abc"
  }
  ```
</ResponseExample>
