---
title: "Initiate a multipart upload"
method: POST
path: "/projects/{projectId}/uploads/multipart/initiate"
tags: ["Uploads"]
---

# Initiate a multipart upload

`POST /projects/{projectId}/uploads/multipart/initiate`

## Request

- Base URL: `https://api.rendley.com/v1`
- URL: `https://api.rendley.com/v1/projects/{projectId}/uploads/multipart/initiate`
- Auth: API key in header `Authorization`

For large files: register the file and get presigned URLs for each part, PUT the parts, then call the multipart complete endpoint with their ETags. media_id and file_hash are optional for API keys (see the create upload endpoint); the response carries the media_id.

## Path parameters

- `projectId` string, required

## Request body

- TypesMultipartInitInput
  - `duration` number
  - `file_hash` string: FileHash is the client-computed content hash (XXH3-64, 16 hex chars). Optional for API keys.
  - `file_size` integer
  - `media_id` string: MediaId is the client-chosen media id (a UUID). Optional for API keys.
  - `metadata` string
  - `mime_type` string
  - `original_file_name` string
  - `part_count` integer, required
  - `project_id` string
  - `role` 'library' | 'pending' | 'staged' | 'transient': Role is the sync-lifecycle tag: "library" (reconciled by the editor's hash sync), "pending" (awaiting auto-injection into the library; invisible to the sync), "staged" (agent/AI workflow file; invisible to the sync AND not auto-injected — adopted to library only when explicitly referenced) or "transient" (never a library asset). Defaults to "library"; "pending" when Source is "mcp"; "staged" for API-key requests (so opening the project in the editor never reaps an API-uploaded file before it is referenced).
  - `source` 'editor' | 'mcp' | 'agent' | 'export' | 'ai' | 'duplicate': Source is provenance: which flow created the upload.

## Response `200`

OK

- object
  - `data` object: Success data
    - `media_id` string: MediaID identifies the file once complete (see CreateUpload.MediaID).
    - `presigned_urls` TypesMultipartPartURL[]
      - `part_number` integer
      - `url` string
    - `s3_upload_id` string
    - `upload_id` string
  - `error` HttpResponseAPIError
    - `code` string
    - `fields` HttpResponseFieldError[]
      - `field` string
      - `message` string
    - `message` string
  - `meta` unknown

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden

---

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