---
title: "Create multipart upload session"
method: POST
path: "/media/uploads"
---

# Create multipart upload session

`POST /media/uploads`

Create a media record and start an S3 multipart upload session.

Use `mediaType: "audio"` to upload a voice note. A voice note is ordinary audio media —
there is no separate voice-note type — so upload it here, then attach the resulting
`mediaUuid` to a chat message. Wait for the media to reach `status: "ready"` on
`GET /media/{mediaUuid}` before sending it: audio is transcoded asynchronously, and a
message sent earlier attaches media the recipient cannot play yet. Duration is measured
during transcoding and returned as `lengthMs` on the media's main variant.

## Headers

- `X-Fanvue-API-Version` string, required

## Request body

- object
  - `name` string, required
  - `filename` string, required
  - `mediaType` 'image' | 'video' | 'audio' | 'document', required — Use "audio" for a voice note — it has no media type of its own.
  - `sizeBytes` integer — Total size of the file in bytes. When provided, the response includes the exact `totalParts` to upload.

## Response `200`

Upload session created

- object
  - `mediaUuid` string, uuid, required
  - `uploadId` string, required
  - `partSize` integer, required — Size in bytes of every part except the final one (which may be smaller).
  - `maxParts` integer, required — Maximum number of parts allowed, derived from the maximum supported file size.
  - `totalParts` integer, nullable, required — Exact number of parts to upload, computed from `sizeBytes`. Null when `sizeBytes` was not provided — compute it client-side as ceil(fileSize / partSize).

## Other responses

- `400` — Bad Request - API version not supported OR validation failed
- `401` — Unauthorized Response
- `403` — Unauthorized Response
- `410` — API version no longer supported (sunset)
- `429` — Too many requests - rate limit exceeded

---

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