---
title: "Add a media library video to an Advanced Local Video(s) banner"
type: reference
method: POST
path: /rest-api/banner/{bannerId}/vast/media-files/from-library.do
tag: "VAST"
---

# Add a media library video to an Advanced Local Video(s) banner

`POST https://YOUR-NETWORK-DOMAIN/rest-api/banner/{bannerId}/vast/media-files/from-library.do`

Adds a media library video to the banner's video files. The file is referenced, not copied, so deleting the row later leaves the library file in place. A video the banner already has is not added again: 'created' is then empty and 'alreadyAdded' names its row. Needs the Advanced Local Video(s) and Media Library permissions and update rights on the banner's advertiser; the file must be one the user can see in the library.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `bannerId` | integer | yes | `5001` | Advanced Local Video(s) banner id |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `mediaAssetId` | integer | yes | `42` | Media library video id |

## Responses

- `200` — {bannerId, created:[id], alreadyAdded, total, mediaFiles:[…]}
- `400` — The file is not a video, not an Advanced Local Video(s) banner, or the file storage service is switched off
- `401` — Authentication error
- `403` — The Advanced Local Video(s) or Media Library permission is off, or no update rights on the banner
- `404` — The banner, or the library file, does not exist or is not visible

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/media-files/from-library.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'mediaAssetId=42'
```

Source: https://epom.com/ad-server/docs/api/vast/post-banner-vast-media-files-from-library