# Media

The Media endpoints allow you to organize, store, upload, and retrieve assets such as images, videos, and documents within the tenant.

Tradly supports structured folder and file hierarchies, direct S3 uploads via presigned URLs, secure presigned download links for private assets, and chunked multipart uploads for large files.

## Media Types

- **`1` (Media / File)**: Individual file resource (e.g. `image/jpeg`, `image/png`, `video/mp4`, `application/pdf`).
- **`2` (Folder)**: Directory node used to group files and subfolders. Root-level items use `parent: 0`.

## Upload Approaches

1. **Direct S3 Signed URL (`/v1/utils/S3signedUploadURL`)**: Request temporary presigned PUT URLs to upload single or multiple assets directly from the client browser or mobile app to S3 storage without routing binary payload through backend application servers.
2. **S3 Multipart Upload (`/v1/utils/S3multipart/...`)**: Ideal for large media or video files. Handles chunked uploads across initialize, part-presigning, completion, and abort lifecycles.
3. **Media Manager Record Creation (`/v1/media`)**: Registers asset URLs and folder metadata into the tenant media library after files are uploaded to storage.
