> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/product-media/upload-product-media.md).

# Upload product media

Upload a new image or video. We accept two kinds of values in the file field, either\
`base64` a Base64 encoded string of the file content, or\
`URL` a URL of the file from where to download the content (make sure that the URL is accessible).

Filename is the name with which the file will be uploaded, e.g. "new-image.jpg".

Required permissions: PRODUCT

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ProductMedia","description":"ProductMedia"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"ProductMediaResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaSchema"}}}}},"schemas":{"ProductMediaSchema":{"title":"ProductMediaSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/UID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"isCoverImage":{"type":"boolean"},"source":{"$ref":"#/components/schemas/ProductMediaSourceENUM"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl","position","width","height","isCoverImage","source","createdAt","createdBy","lastModifiedAt","lastModifiedBy"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ProductMediaSourceENUM":{"title":"ProductMediaSourceENUM","enum":["FLOW","URL"],"description":"","type":"string"},"ProductMediaUploadSchema":{"title":"ProductMediaUploadSchema","type":"object","properties":{"media":{"type":"string","description":"The file content as base64 or source URL."},"filename":{"type":"string"},"position":{"type":"integer"},"productMediaUid":{"$ref":"#/components/schemas/UID"},"setAsCoverImage":{"type":"boolean"}},"required":["media","filename"]}},"requestBodies":{"ProductMediaUploadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMediaUploadSchema"}}}}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/media/upload":{"post":{"summary":"Upload product media","operationId":"post-product-media-upload","responses":{"201":{"$ref":"#/components/responses/ProductMediaResponse"}},"description":"Upload a new image or video. We accept two kinds of values in the file field, either  \n``base64`` a Base64 encoded string of the file content, or  \n``URL`` a URL of the file from where to download the content (make sure that the URL is accessible).\n\nFilename is the name with which the file will be uploaded, e.g. \"new-image.jpg\".\n\nRequired permissions: PRODUCT","tags":["ProductMedia"],"requestBody":{"$ref":"#/components/requestBodies/ProductMediaUploadRequest"}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/product-media/upload-product-media.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
