Browse the help center

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

Reference network manager admin

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

Request examples

List media library files.

ParameterInTypeRequiredDescription
kindquerystringnoVIDEO, IMAGE or HTML5 Values: VIDEO, IMAGE, HTML5.
queryquerystringnoPart of the file’s name or original file name
advertiserIdqueryintegernoOnly files uploaded for this advertiser
widthqueryintegernoExact width in pixels; used together with height
heightqueryintegernoExact height in pixels; used together with width
startqueryintegernoIndex of the first file to return
limitqueryintegernoFiles per page, at most 100
sortquerystringnoCREATED, NAME or SIZE Values: CREATED, NAME, SIZE.
dirquerystringnoASC 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

Request examples

Get a media library file and where it is used.

ParameterInTypeRequiredDescription
assetIdpathintegeryesMedia library file id
usageLimitqueryintegernoUsages 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

Request examples

Delete a media library file.

ParameterInTypeRequiredDescription
assetIdpathintegeryesMedia 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

Request examples

Rename or relabel a media library file.

ParameterInTypeRequiredDescription
assetIdpathintegeryesMedia library file id
nameformstringnoNew display name, up to 255 characters
advertiserIdformintegernoNew 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

Request examples

Add a file to the media library by link.

ParameterInTypeRequiredDescription
urlformstringyesPublic http(s) link to the file
advertiserIdformintegernoAdvertiser the file is for; a filter label
nameformstringnoDisplay 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

Request examples

Upload a file to the media library.

ParameterInTypeRequiredDescription
advertiserIdformintegernoAdvertiser the file is for; a filter label
nameformstringnoDisplay 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 pages

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.