---
title: "Create an upload session"
method: POST
path: "/v1/uploads/sessions"
tags: ["Uploads"]
---

# Create an upload session

`POST /v1/uploads/sessions`

## Request

- Base URL: `https://api.lizzflix.xyz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.lizzflix.xyz/v1/uploads/sessions`
- Auth: none declared

Creates an upload session for an image, video or audio file. `mimeType` must be an allow-listed image/video/audio type; an empty or generic binary type is resolved from the file extension. Other types (HTML, SVG, XML, PDF, ...) are refused with 400. Every `targetRef` id (seriesId, characterId, locationId, episodeId, sceneId) must be the caller's and agree with the others, else 404.

## Request body

- UploadSessionRequest
  - `fileName` string, required
  - `mimeType` string, required
  - `byteSize` number
  - `targetKind` string, required
  - `targetRole` string
  - `targetRef` object
  - `metadata` object

## Response `201`

Upload session created

- UploadSession
  - `sessionId` string, required
  - `assetId` string, required
  - `r2Key` string, required
  - `mode` string, required
  - `uploadToken` string, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `404`: A targetRef id is missing or not the caller's

---

[API](https://skmtc.dev/lizzflix/apis/lizzflix-api.md) · [All operations](https://skmtc.dev/lizzflix/apis/lizzflix-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lizzflix/apis/lizzflix-api/revisions/4536ce9d80ff?raw)
