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

# Initiate Drawing Upload

`POST /api/v1/parts/{part_id}/drawings/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}/drawings/initiate`
- Auth: OAuth 2
  - Password
  - Token URL: `token`
- TypeScript: <https://skmtc.dev/prototyping/apis/prototyping-io-api/docs/api/v1/parts/:part_id/drawings/initiate/post.ts> (a function with typed inputs; its response is checked against the schema)

Initiate a drawing file upload by deriving its R2 key.

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

## Path parameters

- `part_id` string, uuid, required

## Request body

- InitiateDrawingUploadRequest: Request body to obtain a presigned R2 upload URL for a drawing. 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.
  - `file_name` string, required: Original file name including extension (e.g. 'drawing.pdf').
  - `content_type` string, required: MIME type of the file (e.g. 'application/pdf').
  - `file_size` integer, required: Exact file size in bytes. Must not exceed 50 MB.

## Response `200`

Successful Response

- InitiateDrawingUploadResponse: R2 key returned to the client to begin a drawing upload. The client streams the raw file bytes to the proxy upload endpoint ``POST /parts/{part_id}/drawings/upload`` and then calls the confirm endpoint with ``r2_key``.
  - `r2_key` string, required: The R2 object key where the file will be stored.

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