Media Library API endpoints
Endpoint reference for the Media Library tag (6 endpoints): Videos, images and HTML5 ZIPs uploaded once and reused by any number of creatives
Videos, images and HTML5 ZIPs uploaded once and reused by any number of creatives. 6 endpoints, generated from the OpenAPI spec. Authentication, the response envelope, pagination and error codes are shared by all endpoints — see REST API overview. Parameters marked form go in an application/x-www-form-urlencoded request body.
GET /rest-api/media-library/assets.do
List media library files.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
kind | query | string | no | VIDEO, IMAGE or HTML5 Values: VIDEO, IMAGE, HTML5. |
query | query | string | no | Part of the file’s name or original file name |
advertiserId | query | integer | no | Only files uploaded for this advertiser |
width | query | integer | no | Exact width in pixels; used together with height |
height | query | integer | no | Exact height in pixels; used together with width |
start | query | integer | no | Index of the first file to return |
limit | query | integer | no | Files per page, at most 100 |
sort | query | string | no | CREATED, NAME or SIZE Values: CREATED, NAME, SIZE. |
dir | query | string | no | ASC or DESC |
Responses: 200 — {success, available, total, more, start, limit, assets:[{id, name, kind, advertiserId, advertiserName, fileName, contentType, fileSize, width, height, duration, video, url, usedIn, createdAt, createdBy}]}. Errors follow the shared conventions.
GET /rest-api/media-library/assets/{assetId}.do
Get a media library file and where it is used.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
assetId | path | integer | yes | Media library file id |
usageLimit | query | integer | no | Usages to list, at most 500 |
Responses: 200 — {success, asset:{…}, usagesTotal, usagesMore, usages:[{bannerId, bannerName, campaignId, campaignName, advertiserId, advertiserName}]} · 404 — No such file, it is deleted, or the user cannot see it. Errors follow the shared conventions.
POST /rest-api/media-library/assets/{assetId}/delete.do
Delete a media library file.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
assetId | path | integer | yes | Media library file id |
Responses: 200 — {success, assetId, usedIn} · 404 — No such file, it is already deleted, or the user cannot see it. Errors follow the shared conventions.
POST /rest-api/media-library/assets/{assetId}/update.do
Rename or relabel a media library file.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
assetId | path | integer | yes | Media library file id |
name | form | string | no | New display name, up to 255 characters |
advertiserId | form | integer | no | New advertiser label; 0 removes it |
Responses: 200 — {success, asset:{…}} · 404 — No such file, it is deleted, or the user cannot see it. Errors follow the shared conventions.
POST /rest-api/media-library/assets/upload-from-url.do
Add a file to the media library by link.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
url | form | string | yes | Public http(s) link to the file |
advertiserId | form | integer | no | Advertiser the file is for; a filter label |
name | form | string | no | Display name; the file name when empty |
Responses: 200 — {success, duplicate, asset:{…}} · 404 — The advertiser does not exist or is deleted. Errors follow the shared conventions.
POST /rest-api/media-library/assets/upload.do
Upload a file to the media library.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
advertiserId | form | integer | no | Advertiser the file is for; a filter label |
name | form | string | no | Display name; the file name when empty |
Request body (multipart/form-data, required): form with field file — The file: a video, an image or an HTML5 ZIP.
Responses: 200 — {success, duplicate, asset:{…}} · 404 — The advertiser does not exist or is deleted. Errors follow the shared conventions.
Related
- REST API overview — authentication and conventions
- API endpoint reference by tag