Creatives

Set up new creative, fetch creative, update or delete existing creative. When submitting a new creative you’ll need to include the line item to which it should be assigned, this means the line item must have already been created.

Note: Only the following type of line items support creative assignement ‘gtee’, ‘promo’, ‘non_gtee’, ‘backfill_promo’.

JSON Representation

{
  "active": "string",
  "type": "string",
  "dimensions": "string",
  "format": "string",
  "extended": "json",
  "key": "string",
  "lineItemKey": "string",
  "orderKey": "string",
  "orderName": "string",
  "orientation": "string",
  "lineItemName": "string",
  "name": "string",
  "trackingUrl": "string",
  "clickUrl": "string",
  "rewardedType": "string",
}

Field Definitions

Creative Fields

Name Description Required for Post (Create)
active is the creative active no (default to active)
type creative format (image, html, vast, native) yes
format ad format (banner, mrect, fullscreen, rewarded_video) yes
dimensions Choices vary based on format and orientation, see dimensions table below yes
key system generated, can be used to fetch a specific creative no
orientation defaults to faleset true for orientation to be landscape, false for orientation to be portrait no (default is portrait)
lineItemKey key for a direct serve line item to which this creative will be targeted yes
name name of creative yes
trackingUrl This optional field is provided for third party impression tracking URLs. no
clickUrl This URL will called when a user clicks on this ad. no
rewardedType    
extended JSON object describing the actual crative asset, see table below yes
orderKey Order ID no
orderName Order name no

Dimensions table

Format Sizes
Banner 300x50, 320x50, 468x60, 728x90, 970x90, 970x250
MRect 300x250, 336x280
Fullscreen (portrait): 320x480, 320x568, 300x600, 360x640, 768x1024, 300x1050
Fullscreen (landscape): 480x320, 568x320, 640x360, 1024x768

Extended JSON object

Image

Name Description
imageUrl created using the ‘/creatives/image_upload’ endpoint
imageWidth created using the ‘/creatives/image_upload’ endpoint
imageHeight created using the ‘/creatives/image_upload’ endpoint

JSON

"extended": {
  "imageUrl": "string",
  "imageWidth": "integer",
  "imageHeight": "integer"
}

HTML

Name Description
htmlData HTML ad tag
isMraid must be true if the creative requires MRAID

JSON

"extended": {
  "htmlData": "string", 
  "isMraid": "boolean"
}

VAST

Name Description
vastType ‘xml’ or ‘url’
xmlData used when vastType is ‘xml’, set to the XML tag
urlData used when vastType is ‘url’, set to the VAST Tag URL

JSON

"extended": {
  "vastType": "string", 
  "xmlData": "string"
}
"extended": {
  "vastType": "string", 
  "urlData": "string"
}

Native

Name Description
title text for title
text text for body of ad
ctatext text for all to action
iconimage URL for icon image, use the /upload endpoing if needed
mainimage URL for main image, use the /upload endpoing if needed

JSON

"extended": {
    "jsonData": {
        "text": "Make sure to disable the test order from the Orders tab before going live.",
        "mainimage": "http://d30x8mtr3hjnzo.cloudfront.net/creatives/95d0bd71ea8e448ebf4e34fbb670040f",
        "ctatext": "Visit MoPub",
        "iconimage": "http://d30x8mtr3hjnzo.cloudfront.net/creatives/afc50076239d4024b09fae9fa93f98a6",
        "title": "MoPub Native Ads"
    }
}

GET (Read)

https://api.mopub.com/v2/creatives/: returns all creative within the account

https://api.mopub.com/v2/creatives?[FILTER]: see supported filters below

https://api.mopub.com/v2/creatives/[key]: uses an explicit object ID

Filters

If no filter is used, then all objects are returned in a list format. If the filter matches multiple objects, then a list format is returned.

Support filters:

  • name
  • type

POST (Create)

https://api.mopub.com/v2/creatives/

Example JSON for the body of the POST request.

Banner image

{
  "lineItemKey": "b8934ddebdad4437995dda5cd2c678a4",
  "name": "image creative",
  "format": "banner",
  "type": "image",
  "extended": {
    "imageUrl": "https://d34fq0lhiq3aky.cloudfront.net/creatives/bdd6386a87a3459ea8ad9dd39c40986",
    "imageWidth": 823,
    "imageHeight": 705
  },
  "dimensions": "320x50",
  "clickUrl": "http://testclickurl.com",
  "trackingUrl": "http://testimpressionurl.com"
}

Fullscreen HTML

{
  "lineItemKey": "f355ce1bac244cef9dd065cff2d4f26e",
  "name": "HTML creative",
  "format": "fullscreen",
  "type": "html",
  "extended":{
    "htmlData": "<html></html>", "isMraid": true
  },
  "dimensions": "320x480"
}

VAST XML

{
  "lineItemKey": "f355ce1bac2ddcef9b9065cff2d4f26e",
  "name": "VAST XML creative",
  "format": "fullscreen",
  "type": "vast",
  "extended":{
    "vastType": "xml", 
    "xmlData": "<xmldata></xmldata>"
    }
}

VAST Ad Tag

{
  "lineItemKey": "f355c51badc244cef9b9065cff2d4f26e",
  "name": "VAST XML creative",
  "format": "fullscreen",
  "type": "vast",
  "extended": {
      "vastType": "url", 
      "vastUrl": "http://vasturl.com"
  }
}

A successful POST will return the JSON representation for the newly created creative.

PUT (Update)

Usage Details

The operation described here, ‘set’, will just take a dictionary in as “data” and update the object with the settings of that dictionary.

  • Uses http PUT method
  • Request body is json format (not form-data)
  • The response is the modified object

Supported Fields

Format: Banner, MRect, Fullscreen, Native, and Rewarded

  • name
  • dimensions
  • clickUrl
  • trackingUrl
  • image

Format: Rewarded

  • name
  • vastType
  • xmlData
  • urlData

Format: Native

Example

https://api.mopub.com/v2/creatives/5197a8u32adc49a8beb08e3dd87c22ww

{
  "op": "set",
  "data":{
        "name": "New Name"
  }
}

DELETE

Creative can be deleted by sending a DELETE request with the desired creative id to delete appended to the end of the REST API endpoint.

/v2/creatives/<key>

Note: This delete is final. MoPub has no way to recover deleted creative.


Last updated July 21, 2021

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2021 MoPub (a division of Twitter, Inc.)