Skip to content

Preview creative assets before uploading

Request

Preview creative assets before permanently uploading them. The endpoint validates files and metadata and returns the submission shape that /creative_upload would process, without creating creatives.

Creative upload limits:

Creative upload shapeLimit
Plain/non-ZIP uploaded files500KB per uploaded file
Uploaded ZIP package10MB per ZIP file
Direct files in the uploaded outer ZIP500KB per direct file
Assets inside an inner HTML5 package ZIP500KB recommended maximum; warning only
Uploaded filename form parts10 files max

Send all files in a request with either the filename multipart field name or the legacy filename[] multipart field name; do not mix both field names in the same request. The OpenAPI x-max-file-size: 10485760 value is the transport/schema ceiling for uploaded ZIP parts. Non-ZIP 500KB and direct outer-ZIP file 500KB limits are endpoint validation rules. Assets inside an inner HTML5 package ZIP over 500KB are accepted with a meta.warnings entry unless the html5-file-too-large sub_code is promoted to an error by configuration. If multiple ZIP files are uploaded, ZIP structural/content validation preserves the legacy behavior of validating the first ZIP selected by the request.

Top-level uploads may use image extensions (.gif, .jpg, .jpeg, .png, .tiff, .tif, .svg), the legacy .swf extension, loose HTML/CSS/JS/font extensions (.html, .htm, .css, .js, .woff, .woff2, .ttf, .otf), or ZIP packages. ZIP-inner HTML5 assets may use image extensions plus .html, .htm, .css, .js, .woff, .woff2, .ttf, .otf, .mp4, and .webm.

HTML5 packages must use a two-level ZIP structure: the outer ZIP contains one or more inner ZIP files, each inner ZIP contains the HTML5 creative assets, and backup images are included in the outer ZIP. Loose files must not be uploaded alongside an HTML5 ZIP package. Nested ZIPs beyond two levels are rejected.

HTML5 validation errors and warnings use these stable sub_code values:

sub_codeDefault dispositionScopeTrigger
html5-missing-click-trackerErrorInner packageNo HTML/JS file contains a MediaMath click-tracker macro
html5-noscript-tagWarningInner packageRoot HTML contains a <noscript> tag
html5-storage-apiWarningInner packageHTML/JS file uses localStorage or sessionStorage
html5-external-referenceWarningInner packageRoot HTML references an external asset
html5-invalid-filename-charsWarningInner packageFile name contains spaces, non-ASCII, or other non-standard characters
html5-missing-file-extensionWarningInner packageExtensionless file is recognized by content signature or root HTML reference
html5-unsafe-filename-pathErrorInner packageFile path is absolute, contains ./.., drive-letter, or UNC path components
html5-filename-too-longErrorInner packageFile path exceeds 255 characters
html5-unsupported-file-typeErrorOuter ZIP and inner packageFile extension is not allowed
html5-file-too-largeWarningInner packageInner package asset exceeds the recommended 500KB maximum
html5-file-too-largeErrorOuter ZIP direct entryDirect entry in uploaded outer ZIP exceeds 500KB
html5-file-read-errorErrorInner packageExtracted HTML/JS file cannot be read
html5-backup-mismatchWarningHTML5 package auto-discoveryBackup image matches the package name only by letter case
html5-backup-mismatchErrorHTML5 package auto-discoveryNo backup metadata and no matching backup image exists
html5-backup-mismatchErrorHTML5 package manual backupSpecified backup file is absent from the ZIP
html5-invalid-package-structureErrorOuter ZIPHTML appears directly in the outer ZIP
html5-nested-zip-too-deepErrorOuter ZIPZIP nesting exceeds two levels
html5-separate-filesErrorMultipart requestLoose files are uploaded alongside an HTML5 ZIP package
html5-submission-name-mismatchErrorOuter ZIP (HTML5)Inner ZIP name is missing from metadata.submissions[].name
submission-name-mismatchErrorOuter ZIP (non-HTML5)Plain ZIP file is missing from metadata.submissions[].name
zip-too-largeErrorUploaded ZIPUploaded ZIP exceeds 10MB
html5-validation-errorErrorFallbackInternal fallback for an unmapped HTML5 validation rule
Security
Auth0(Required scopes: offline_accessmanage:services)
Bodymultipart/form-datarequired
filenameArray of strings, (binary), [ 1 .. 10 ] items(creative_upload_filename)required

Creative files to upload. Send all files in a request as either filename or the legacy filename[] field name; do not mix both field names in the same request.

Loose/non-ZIP uploads are limited to 500KB per file. Uploaded ZIP packages are limited to 10MB per ZIP. Direct files in the uploaded outer ZIP are limited to 500KB. Assets inside an inner HTML5 package ZIP over 500KB are accepted with a warning unless the html5-file-too-large sub_code is promoted to an error. If multiple ZIP files are uploaded, ZIP structural/content validation preserves the legacy behavior of validating the first ZIP selected by the request.

metadataobject(creative_upload_metadata_draft)required

JSON metadata for the preview request. submissions is optional for draft: when omitted, the API attempts to infer submission entries from the uploaded files.

curl -i -X POST \
  https://api.mediamath.com/api/v3.0/creative_draft \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F filename=@banner_300x250.jpg \
  -F 'metadata="{\"advertiser_id\":100212,\"is_https\":true,\"submissions\":[{\"name\":\"banner_300x250.jpg\",\"click_through_url\":\"https://example.com/click\",\"landing_page\":\"https://example.com/landing\",\"concept_id\":4157184}]}";type=application/json'

Responses

Preview generated successfully

Bodyapplication/json
dataobject(creative_draft_response_data)
metaobject(creative_single_metadata_with_warnings)
Response
{ "data": { "uploaded_files": [ … ], "metadata": { … } }, "meta": { "status": "success" } }