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

# Get Upload URLs

> Generate pre-signed URLs for multi-part file uploads

Generates pre-signed URLs for uploading raw data files to Atomscale using multi-part upload. Each part gets its own pre-signed URL.

<ParamField query="original_filename" type="string" required>
  Original filename with extension (e.g., `rheed_video.mp4`)
</ParamField>

<ParamField query="num_parts" type="integer" required>
  Number of upload parts to generate URLs for
</ParamField>

<ParamField query="staging_type" type="string" default="core">
  Staging bucket type: `core`, `instrument`, or `stream`
</ParamField>

<ParamField body="physical_sample_id" type="string">
  Physical sample UUID to associate with the upload
</ParamField>

<ParamField body="physical_sample_name" type="string">
  Name for a new physical sample to create and associate
</ParamField>

<ParamField body="notes" type="string">
  Notes to attach to the data entry
</ParamField>

<ParamField body="data_stream" type="string">
  Data stream type (e.g., `rheed`, `optical`, `metrology`)
</ParamField>

## Response

Returns an array of pre-signed upload URL objects, one per part.

<ResponseField name="upload_id" type="string">
  Upload session identifier
</ResponseField>

<ResponseField name="new_filename" type="string">
  Server-assigned filename for this part
</ResponseField>

<ResponseField name="url" type="string">
  Pre-signed URL for uploading this part (PUT request)
</ResponseField>

<ResponseField name="data_id" type="string">
  Data entry UUID created for this upload
</ResponseField>

<ResponseField name="part" type="integer">
  Part number
</ResponseField>

<RequestExample>
  ```python SDK theme={null}
  from atomscale import Client

  client = Client(api_key="YOUR_API_KEY")
  # The SDK handles multi-part upload automatically
  client.upload(files=["rheed_video.mp4"])
  ```

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

  response = requests.post(
      "https://api.atomscale.ai/data_entries/raw_data/staged/upload_urls/",
      headers={"X-API-KEY": "YOUR_API_KEY"},
      params={
          "original_filename": "rheed_video.mp4",
          "num_parts": 1
      }
  )
  upload_urls = response.json()

  # Upload the file using the pre-signed URL
  with open("rheed_video.mp4", "rb") as f:
      requests.put(upload_urls[0]["url"], data=f)
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.atomscale.ai/data_entries/raw_data/staged/upload_urls/?original_filename=rheed_video.mp4&num_parts=1" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "upload_id": "abc123",
      "new_filename": "staged_rheed_video.mp4",
      "url": "https://storage.atomscale.ai/uploads/staged_rheed_video.mp4?token=...",
      "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "part": 1
    }
  ]
  ```
</ResponseExample>
