# Media

> A Media is an uploaded file (image, video or document) you attach to products and variants.

A **Media** is a file you upload once and then attach to catalog resources. Each media exposes a `contentUrl` to fetch the file, its `mimeType`, a derived `type` (`image`, `video` or `file`), a `hash`, and - for images - its `dimensions`.

You create a media by **uploading a file**, then reference the returned media IRI from a [Product](/api/product-management/products/) or [Variant](/api/product-management/variants/) through their `medias` list.

## The Media object

## Common workflows

- **Add a product image.** [Upload the file](/api/product-management/medias/create/), then add the returned media IRI to a [Variant](/api/product-management/variants/)'s `medias` (or a product's).
- **Serve the file.** Use the `contentUrl` from the media to display it.
- **Clean up.** [Delete](/api/product-management/medias/delete/) a media that is no longer referenced.

## Conventions

### Authentication and headers

All requests require an OAuth 2.0 bearer token and the organization scope header:

```
Authorization: Bearer <token>
X-Flowkiwi-Organization-Id: <organization-id>
```

### Uploading

Media are created with a `multipart/form-data` upload, not a JSON body. Send the binary in a `file` field (max 5 MB for general files, 100 MB for videos). The `mimeType`, `type`, `hash` and image `dimensions` are derived from the uploaded file - you don't set them.
