Skip to content

Creative files upload guide

Creatives are uploaded to a campaign using POST /campaigns/{campaignId}/creatives. The API supports four upload methods depending on your content type.

All upload methods require these headers:

HeaderDescription
X-API-KeyYour API key
Acceptapplication/json
Content-TypeVaries by method (see below)
X-FilenameOptional. Sets the display name in the Advalidation UI. Defaults to a timestamp-based name if omitted.

Content-Type: application/json

Best for: URLs, HTML tags, VAST tags, and other text-based content.

Send the content in a payload field:

curl -X POST https://app.advalidation.io/v2/campaigns/CAMPAIGN_ID/creatives \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -H "X-Filename: Interactive.html" \
  -d '{"payload": "<iframe src=\"https://labs.advalidation.net/animation/10s/\" style=\"border:0; width:300px; height:250px;\" scrolling=\"no\"></iframe>"}'

Content-Type: application/json

Best for: Binary files (images, videos, ZIP archives) when you need to use JSON.

Encode the file as a base64 string and send it in the payload field:

BASE64=$(base64 < ./creative.mov)
curl -X POST https://app.advalidation.io/v2/campaigns/CAMPAIGN_ID/creatives \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -H "X-Filename: creative.mov" \
  -d "{\"payload\": \"$BASE64\"}"

Content-Type: text/plain

Best for: Raw HTML files or plain text content.

Send the file content directly as the request body:

curl -X POST https://app.advalidation.io/v2/campaigns/CAMPAIGN_ID/creatives \
  -H "Accept: application/json" \
  -H "Content-Type: text/plain" \
  -H "X-API-Key: your-api-key-here" \
  -H "X-Filename: creative.html" \
  --data-binary @./creative.html

Content-Type: application/octet-stream

Best for: ZIP archives, images, videos, and other binary files. Most efficient for large files since there is no encoding overhead.

Send the raw file bytes as the request body:

curl -X POST https://app.advalidation.io/v2/campaigns/CAMPAIGN_ID/creatives \
  -H "Accept: application/json" \
  -H "Content-Type: application/octet-stream" \
  -H "X-API-Key: your-api-key-here" \
  -H "X-Filename: creative.zip" \
  --data-binary @./creative.zip
MethodContent-TypeEncoding overheadBest for
JSON payloadapplication/jsonNone (text)URLs, HTML tags, VAST tags
JSON base64application/json~30% largerBinary files when JSON is required
Plain texttext/plainNoneRaw HTML files
Binaryapplication/octet-streamNoneZIP, images, videos (most efficient)