Skip to content

Create a new video creative

Request

Create a new video creative - V3.

Uploading a video file

To upload a video, supply the fileName field in the request body (see the Create with fileName sample in the Request samples panel). The response then includes a pre-signed S3 uploadUrl (valid for expiresIn seconds), which the client uses to PUT the file directly to S3:

curl -X PUT \
    -H "x-amz-acl: public-read" \
    -H "x-amz-meta-creative: {{CREATIVE_ID}}" \
    -H "Content-Type: {{UPLOADED_FILE_CONTENT_TYPE}}" \
    --upload-file "{{UPLOADED_FILE_PATH/File.mp4}}" \
    "{{S3_PRESIGNED_URL}}"

The x-amz-acl: public-read and x-amz-meta-creative: <creativeId> headers are required (both are signed into the pre-signed URL).

Bodyapplication/json

Creative object to create

activeboolean
Default:false
advertiserinteger, (int64)required

T1 Advertiser ID

namestring, <= 256 charactersrequired

Creative name (required, max 256 chars)

conceptinteger, (int64)required

T1 Concept ID (mandatory for creation)

startTimeinteger, (int64)

Creative start date (Unix timestamp, must be >= 0 and < year 10000)

endTimeinteger, (int64)

Creative end date (Unix timestamp, must be >= startTime)

clickthroughUrlstring

Clickthrough URL (required unless customVAST or customVASTUrl is set)

customVASTstring

VAST XML content (mutually exclusive with customVASTUrl)

customVASTUrlstring

URL to VAST XML content (mutually exclusive with customVAST)

viewabilityTemplatestring

VAST XML template for BYOT viewability (must contain VPAID_AD_PARAMETERS.URL macro)

landingUrlstring

Declared landing page. If empty, landing URL will be fetched from VAST XML.

eventPixelsArray of objects(EventPixelRequest)

Additional pixels

vendorsArray of integers, (int64), unique

T1 Vendor IDs

vastVersionstring(VASTVersion)
Default:"VAST2"
Enum:"VAST2""VAST3""VAST4"
disabledVariantsArray of integers, unique

Disabled variant IDs

externalIdentifierstring, <= 64 characters

External Identifier (requires customVAST or customVASTUrl)

clockNumberstring, <= 15 characters

Clock Number for Clearcast (UK freewheel broadcasters)

customVASTExtensionXMLstring

Custom VAST Extension XML

fileNamestring

Optional. File name including extension (e.g. my-video.mp4). When provided, a pre-signed S3 PUT URL is returned in the response. Mutually exclusive with customVAST and customVASTUrl. The S3 PUT request must include headers x-amz-acl: public-read and x-amz-meta-creative: .

curl -i -X POST \
  https://api.mediamath.com/v3.0/creatives \
  -H 'Content-Type: application/json' \
  -d '{
    "active": false,
    "advertiser": 0,
    "name": "string",
    "concept": 0,
    "startTime": 0,
    "endTime": 0,
    "clickthroughUrl": "string",
    "customVAST": "string",
    "customVASTUrl": "string",
    "viewabilityTemplate": "string",
    "landingUrl": "string",
    "eventPixels": [
      {
        "typ": "string",
        "url": "string"
      }
    ],
    "vendors": [
      0
    ],
    "vastVersion": "VAST2",
    "disabledVariants": [
      0
    ],
    "externalIdentifier": "string",
    "clockNumber": "string",
    "customVASTExtensionXML": "string",
    "fileName": "string"
  }'

Responses

Creative created successfully

Bodyapplication/json
creativeIdinteger
uploadUrlstring

Pre-signed S3 PUT URL (only present when fileName was provided in the request). Valid for expiresIn seconds. The PUT request must include headers x-amz-acl: public-read and x-amz-meta-creative: .

expiresIninteger

Seconds until uploadUrl expires (900). Only present when uploadUrl is set.

statusobject(Status)
Response
{ "creativeId": 0, "uploadUrl": "string", "expiresIn": 0, "status": { "code": "string", "message": "string" } }