---
title: "Create an upload"
method: POST
path: "/uploads"
tags: ["uploads"]
---

# Create an upload

`POST /uploads`

Creates an upload record for a direct single-PUT transfer. Next, request a presigned URL with POST /uploads/{id}/upload-url, PUT the bytes to it, then mark the upload complete with POST /uploads/{id}/complete.

## Headers

- `Idempotency-Key` string

## Request body

- CreateUploadRequest — CreateS3ObjectInput is used for create S3Object object. Input was generated by ent.
  - `duration` integer, nullable
  - `fileSize` integer, nullable
  - `fps` number, nullable
  - `hasAudio` boolean, nullable
  - `hasVideo` boolean, nullable
  - `height` integer, nullable
  - `isDeleted` boolean, nullable
  - `mimeType` string, required
  - `name` string, required
  - `orientation` integer, nullable
  - `path` string, nullable
  - `type` 'audio' | 'video' | 'image', required
  - `width` integer, nullable

## Response `201`

Created.

- Upload
  - `createdAt` string, date-time, required
  - `fileSize` integer, nullable
  - `id` string, required
  - `mimeType` string, required
  - `name` string, required
  - `type` 'audio' | 'video' | 'image', required
  - `uploaded` boolean, required

## Other responses

- `401` — Missing or invalid access token.
- `403` — The token lacks the required scope or access to the resource.
- `404` — The resource does not exist or is not visible to the caller.
- `422` — The request body or parameters are invalid.
- `429` — Rate limit exceeded. Retry after the indicated delay.
- `502` — The upstream data service returned an error.

---

[API](https://skmtc.dev/streamloop/apis/streamloop-api.md) · [All operations](https://skmtc.dev/streamloop/apis/streamloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/streamloop/streamloop-api/revisions/7f30ccbac1b1/schema)
