---
title: "Initiate Upload"
method: POST
path: "/api/v1/parts/{part_id}/cad/initiate"
tags: ["cad-uploads"]
---

# Initiate Upload

`POST /api/v1/parts/{part_id}/cad/initiate`

## Request

- Base URL: `https://api.prototyping.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.prototyping.io/api/v1/parts/{part_id}/cad/initiate`
- Auth: OAuth 2
  - Password
  - Token URL: `token`
- TypeScript: <https://skmtc.dev/prototyping/apis/prototyping-io-api/docs/api/v1/parts/:part_id/cad/initiate/post.ts> (a function with typed inputs; its response is checked against the schema)

Initiate a CAD file upload by creating a CadFileVersion row.

Returns the ``r2_key`` and ``version_id``. The client then streams the
raw file bytes to ``POST /parts/{part_id}/cad/upload/{version_id}`` and
finally calls ``POST /confirm`` with the ``version_id`` and ``r2_key``.

## Path parameters

- `part_id` string, uuid, required

## Request body

- InitiateUploadRequest: Request body to obtain a presigned R2 upload URL. The client provides the original file name, MIME type, and exact size so the backend can validate the extension and size *before* generating the presigned URL. This prevents wasted bandwidth on files that would be rejected after upload.
  - `file_name` string, required: Original file name including extension (e.g. 'bracket_v2.step').
  - `content_type` string, required: MIME type of the file (e.g. 'application/octet-stream').
  - `file_size` integer, required: Exact file size in bytes. Must not exceed 20 MB.

## Response `200`

Successful Response

- InitiateUploadResponse: R2 key and metadata returned to the client to begin a CAD upload. The client streams the raw file bytes to the proxy upload endpoint ``POST /parts/{part_id}/cad/upload/{version_id}`` and then calls the confirm endpoint with ``version_id`` and ``r2_key``.
  - `r2_key` string, required: The R2 object key where the file will be stored.
  - `version_id` string, uuid, required: Newly created CadFileVersion ID to reference in subsequent calls.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/prototyping/apis/prototyping-io-api.md) - [All operations](https://skmtc.dev/prototyping/apis/prototyping-io-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prototyping/apis/prototyping-io-api/revisions/f4a0079fbb57?raw)
