> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference videos

> Upload videos and retrieve their URLs via the Admin Interface API videos endpoint, supporting MP4, MOV, WebM, MKV, and other configured formats.

The `videos/` endpoint provides an interface for managing videos in the shop system. Videos can be uploaded and the corresponding URLs can be queried via the API.

Various video formats are supported, as well as individual restrictions such as maximum file size and allowed formats, which are controlled via the shop configuration `content.videoSettings`.

***

## Supported methods

List of all supported methods.

| **Command/Info** | **Endpoints**         | **GET**             | **PUT**             | **POST**              | **DELETE**          |
| ---------------- | --------------------- | ------------------- | ------------------- | --------------------- | ------------------- |
| **Video URL**    | <Icon icon="check" /> | <Icon icon="ban" /> | <Icon icon="ban" /> | <Icon icon="ban" />   |                     |
|                  | **Video upload**      | <Icon icon="ban" /> | <Icon icon="ban" /> | <Icon icon="check" /> | <Icon icon="ban" /> |

## General

* **Supported video formats:**
  * `mp4`
  * `avi`
  * `mov`
  * `wmv`
  * `flv`
  * `mkv`
  * `webm`
  * `mpeg`
  * `3gp`
  * `ogg/ogv`
* **Maximum file size**\
  Defined via the configuration `content.videoSettings`.
* **Allowed formats**\
  The permitted video formats can also be configured via `content.videoSettings`.

## Methods for video upload

### GET videos/url/\{typeId}

This endpoint returns the URL where videos of the specified type (e.g. category or product videos) are stored. The path parameter `typeId` must have the value `categories` or `products`.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
http://www.<your-shop>.de/admin/api/v1/videos/url/categories
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "url": "//content.myshop.localhost/categories/video"
}
```

#### Error codes

| **Error**        | **Type**       | **Reason**                                                                 |
| ---------------- | -------------- | -------------------------------------------------------------------------- |
| 401 Unauthorized |                | Not authorized: you are not logged in.                                     |
| 403 Forbidden    |                | You do not have the required permissions to read category or product data. |
| 400 Bad Request  | "invalidValue" |                                                                            |
| 400 Bad Request  | "missing"      | `subshopId` was not provided.                                              |

### POST videos/upload/\{typeId}

This endpoint allows uploading a video for a specified type (e.g. categories or products). The path parameter `typeId` must have the value `categories` or `products`.

The request body must contain the file name (`fileName`) and the binary data of the video (`videoData`). After a successful upload, the name of the uploaded file is returned.

Write permissions for category or product data are required.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
http://www.<your-shop>.de/admin/api/v1/videos/upload/categories?subshopId=deutsch
```

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Content-Type: multipart/form-data

fileName: myVideo.mp4
videoData: <binary data of the video file>
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "newFile": "myVideo.mp4"
}
```

#### Error codes

| **Error**               | **Type**            | **Reason**                                                                                                       |
| ----------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| 401 Unauthorized        |                     | Not authorized: you are not logged in.                                                                           |
| 403 Forbidden           |                     | You do not have the required permissions to write category or product data.                                      |
| 400 Bad Request         | "missing"           | `subshopId` was not provided.<br />`video` was not provided (if `fileName` or `videoData` are missing or empty). |
| 400 Bad Request         | "invalidValue"      |                                                                                                                  |
| 400 Bad Request         | "invalidFileFormat" | The video has an invalid format.                                                                                 |
| 503 Service Unavailable | "internalError"     | The upload failed.                                                                                               |

## Support

Bei technischen Fragen und Hilfestellungen ist unser Support-Team für Sie erreichbar: [Zum Kundenportal](https://websale.atlassian.net/servicedesk/customer/portal/6)

Bitte senden Sie uns eine möglichst detaillierte Beschreibung sowie Screenshots, Requests/Antworten, damit wir Ihre Anfrage zeitnah und zielführend beantworten können.
