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

# Media

> Upload video and image files to associate with your Videowise content.

## Base URL

`https://api.videowise.com`

***

### Upload Media

#### **POST** `/external/media/v1`

Uploads a video or image file to Videowise.

#### Headers

| Key                        | Type   | Required | Description                            |
| -------------------------- | ------ | -------- | -------------------------------------- |
| `X-Videowise-Access-Token` | String | Yes      | Access token to authorize the request. |

#### Request Body

The request must be sent as `multipart/form-data`.

| Field         | Type | Required | Description               |
| ------------- | ---- | -------- | ------------------------- |
| `fileContent` | File | Yes      | The media file to upload. |

#### File Limitations

<CardGroup cols={2}>
  <Card title="Video Files" icon="video">
    **Max size:** 50 MB

    **Supported formats:**

    * `.mp4`
    * `.mov`
  </Card>

  <Card title="Image Files" icon="image">
    **Max size:** 5 MB

    **Supported formats:**

    * `.jpeg` / `.jpg`
    * `.webp`
    * `.png`
    * `.gif`
    * `.avif`
  </Card>
</CardGroup>

#### Example Request

```bash theme={null}
curl -X POST https://api.videowise.com/external/media/v1 \
  -H "X-Videowise-Access-Token: <your_access_token>" \
  -F "fileContent=@/path/to/your/video.mp4"
```

#### Response

| Field | Type   | Description                                  |
| ----- | ------ | -------------------------------------------- |
| `id`  | String | The unique identifier of the uploaded media. |
| `url` | String | The URL of the uploaded media file.          |

```json theme={null}
{
  "id": "6a0ef7bd30cc5df396bf8bbf",
  "url": "https://cdn2.videowise.com/media/custom-videos/videos/1779365821653_wid_NmEwZWY3YmQzMGNjNWRmMzk2YmY4YmJm.mp4",
  "hostKey": "custom-videos/videos/1779365821653_wid_NmEwZWY3YmQzMGNjNWRmMzk2YmY4YmJm.mp4"
}
```

| Status | Description                                      |
| ------ | ------------------------------------------------ |
| `200`  | Media uploaded successfully.                     |
| `400`  | Bad request. File type or size is not supported. |
| `401`  | Unauthorized access.                             |

***

## Error Codes

| Status | Description                                                           |
| ------ | --------------------------------------------------------------------- |
| `400`  | Bad request. File type is not allowed or file exceeds the size limit. |
| `401`  | Unauthorized. Access token is missing or invalid.                     |

***
