API Reference

Media library

Images live in a shared media library served from our CDN host. Upload files, import by URL, or let us screenshot a page for you.

Endpoints

MethodEndpointDescription
POST/mediaUpload a file (multipart)
GET/media?site=…&kind=…List library items, filterable
DELETE/media/:midDelete a file
POST/media/importFetch an image from a URL into the library
POST/media/screenshotQueue an automated page screenshot (async)
GET/media/jobs/:jidCheck a screenshot job's result

Requires the media_library plan feature.

Kinds

Every upload carries a kind so the library stays organized and the right images surface in the right pickers:

KindUsed for
site_logoSite header logo
offer_logoOffer card logos
offer_shotOffer gallery images (see Offers & galleries)
bannerCategory banners
article_imageFeatured article images
miscEverything else (default)

Upload

Multipart form with file, kind and site_id. The response gives you the public URL and the media id for attaching elsewhere.

Upload a logo
curl -X POST $API/media \
  -H "Authorization: Bearer $KEY" \
  -F "[email protected]" -F "kind=offer_logo" -F "site_id=$SITE_ID"
# → {"media": {"id": "…", "url": "https://media.vouchdock.com/…/logo.png", …}}

Dimensions and size are detected server-side; the response includes width, height, size_bytes, mime and any generated variants.

Import from URL

Hand us a URL, we fetch and host it — the migration-friendly way to move image assets off an old platform without downloading anything yourself.

Import
curl -X POST $API/media/import \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d '{"url": "https://old-site.com/assets/hero.png", "kind": "banner", "site_id": "'$SITE_ID'"}'

Automated screenshots

We render the page with headless Chromium and store the result in your library. Async: queue a job, poll until done, then attach the resulting media id (e.g. as an offer logo or gallery image).

Screenshot flow
# 1. queue
JOB=$(curl -s -X POST $API/media/screenshot \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d '{"url": "https://acmevpn.example.com", "offer_id": "'$OFFER_ID'", "site_id": "'$SITE_ID'"}' \
  | jq -r .job_id)

# 2. poll (usually done in a few seconds)
curl -s $API/media/jobs/$JOB -H "Authorization: Bearer $KEY"
# → {"status": "done", "media_id": "…"}  (pending | running | done | failed)