---
title: "Start media upload session"
method: POST
path: "/media/upload-sessions"
tags: ["Media"]
---

# Start media upload session

`POST /media/upload-sessions`

## Request

- Base URL: `https://api.woopsocial.com/v1`
- URL: `https://api.woopsocial.com/v1/media/upload-sessions`
- Auth: HTTP bearer

This endpoint can be used to upload both smaller and larger files (up to 5GB) in a chunked manner.
Calling this creates an upload session and returns presigned URLs for uploading the file in parts.

Upload the file in `partCount` parts, using the matching
`parts[n].uploadUrl` for each part number.

Every part except the last must be exactly `partSizeInBytes` bytes. The
last part may be smaller. After all parts have been uploaded, call
`/media/upload-sessions/{uploadSessionId}/complete` to finalize the upload
and create the media item.

## Request body

- CreateUploadSessionRequest
  - `fileSizeInBytes` integer, required: Total size of the file that will be uploaded.
  - `projectId` string, required: Project that will own the uploaded media.

## Response `200`

Upload session created.

- UploadSession
  - `expiresAt` string, date-time, required: Time when the presigned part upload URLs expire.
  - `partCount` integer, required: Number of parts that must be uploaded before completion.
  - `partSizeInBytes` integer, required: Maximum chunk size to use when slicing the file into parts. For uploads with more than one part, every part except the last must be exactly this size. The last part may be smaller. For a single-part upload, the only part may be smaller than this size.
  - `parts` UploadSessionPart[], required: Presigned upload targets, in part-number order.
    - `partNumber` integer, required: 1-based part number to upload to this URL.
    - `uploadUrl` string, uri, required: Presigned URL that accepts the bytes for `partNumber`.
  - `uploadSessionId` string, required: Media upload session identifier.

## Other responses

- `429`: Too many requests are already in progress for this API key.

---

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