> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Multipart start

> Create a multipart session and receive part size plus presigned PUT URLs.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://upload.autorender.io/api/v1/multipart/start \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "file_name": "big-video.mp4",
    "size": 73400320,
    "format": "video/mp4",
    "folder": "uploads/videos",
    "tags": ["campaign", "raw"],
    "metadata": { "source": "mobile-app" },
    "custom_id": "vid_001",
    "random_prefix": false,
    "ttl_seconds": 3600
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "part_size": 10485760,
    "parts": [
      "https://storage.example.com/presigned-part-1?X-Amz-Signature=abc",
      "https://storage.example.com/presigned-part-2?X-Amz-Signature=def"
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "<string>"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized",
    "message": "Invalid or missing API key"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "error": "<string>",
    "message": "<string>"
  }
  ```
</ResponseExample>

## Overview

Starts a multipart upload for large files. The response gives you `session_id`, **`part_size`** (the chunk size in bytes), and **`parts`** (presigned URLs, in order). Upload each chunk with [Upload parts](/docs/api-reference/multipart-upload-parts), then finalize with [Multipart complete](/docs/api-reference/multipart-complete).

## Authentication

`Authorization: Bearer YOUR_API_KEY`

## Workflow

This is **step 1 of 3**.

1. **Multipart start** (this endpoint) — get `session_id`, `part_size`, and `parts`.
2. [**Upload parts**](/docs/api-reference/multipart-upload-parts) — `PUT` each chunk to the matching presigned URL.
3. [**Multipart complete**](/docs/api-reference/multipart-complete) — finalize the file in your workspace.

## Request body

| Field           | Type      | Required | Description                                |
| --------------- | --------- | -------- | ------------------------------------------ |
| `file_name`     | string    | Yes      | Original file name (e.g. `big-video.mp4`)  |
| `size`          | number    | Yes      | Total file size in bytes                   |
| `format`        | string    | Yes      | MIME type (e.g. `video/mp4`, `image/jpeg`) |
| `folder`        | string    | No       | Workspace folder path                      |
| `tags`          | string\[] | No       | Tags                                       |
| `metadata`      | object    | No       | Custom metadata                            |
| `custom_id`     | string    | No       | Your tracking id                           |
| `random_prefix` | boolean   | No       | Random prefix on stored name if `true`     |
| `ttl_seconds`   | number    | No       | Lifetime of the presigned URLs, in seconds |

## Response

Returns `session_id`, `part_size`, and `parts`. Part index `i` must be uploaded to `parts[i]`.


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/multipart/start
openapi: 3.0.0
info:
  title: AutoRender Public API
  description: >-
    REST API for uploading, managing, and serving media assets. All endpoints
    require an API key via the x-api-key header or Authorization: Bearer <key>.
  version: 1.0.0
  contact:
    name: AutoRender Support
    email: support@autorender.io
servers:
  - url: https://app-api.autorender.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Uploads
    description: Upload endpoints (API key required)
  - name: Files
    description: File management endpoints (API key required)
  - name: Folders
    description: Folder management endpoints (API key required)
paths:
  /api/v1/multipart/start:
    post:
      tags:
        - Uploads
      summary: Start multipart upload
      description: Initialise a multipart upload session and receive pre-signed part URLs.
      operationId: multipartStart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_name:
                  type: string
                  minLength: 1
                size:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                format:
                  type: string
                  minLength: 1
                folder:
                  type: string
                tags:
                  anyOf:
                    - type: array
                      items:
                        type: string
                    - type: string
                metadata:
                  type: object
                  additionalProperties:
                    x-stainless-any: true
                custom_id:
                  type: string
                random_prefix:
                  type: boolean
                ttl_seconds:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
              required:
                - file_name
                - size
                - format
      responses:
        '201':
          description: Session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
                  uuid:
                    type: string
                  part_size:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  min_part_size:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  parts:
                    type: array
                    items:
                      type: string
                    description: Pre-signed S3 upload URLs, one per part
                  expire_at:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Unix timestamp when the session expires
                  public_key:
                    type: string
                  workspace_id:
                    type: string
                  policy:
                    type: object
                    properties:
                      folder:
                        type: string
                      tags:
                        type: array
                        items:
                          type: string
                      size:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      format:
                        type: string
                    required:
                      - folder
                      - tags
                      - size
                      - format
                    additionalProperties: false
                required:
                  - session_id
                  - uuid
                  - part_size
                  - min_part_size
                  - parts
                  - expire_at
                  - public_key
                  - workspace_id
                  - policy
                additionalProperties: false
                description: Session created
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
                  errorCode:
                    type: string
                  message:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Invalid request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Unauthorized
        '402':
          description: Storage limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
                  errorCode:
                    type: string
                  message:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Storage limit exceeded
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  retryAfterSeconds:
                    type: number
                required:
                  - error
                  - message
                additionalProperties: false
                description: Rate limit exceeded
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
                  errorCode:
                    type: string
                  message:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Server error
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for public endpoints. Can also be provided via Authorization:
        Bearer <key>

````