Developers Dashboard

Upload images, videos and files, or have Unvop fetch them from a URL, and use them on pages.

Every site has a media library: the images, videos and files its pages use. Upload a file, or send a URL and Unvop downloads it. Either way you get back a url to put in an image prop or a collection field.

Uploading needs media:write (which content:write also grants).

Upload a file

Send it as multipart/form-data in a file field, with optional alt text:

curl https://api.unvop.com/v1/sites/site_…/media \
  -H "Authorization: Bearer $UNVOP_KEY" \
  -F "file=@sourdough.jpg" \
  -F "alt=A sourdough loaf on the counter"

Or send a URL

Send JSON with an https URL and Unvop fetches the file itself:

POST /sites/{siteId}/media
{ "url": "https://images.example.com/sourdough.jpg", "alt": "A sourdough loaf on the counter" }

What comes back

201 with the file: its id, url, filename, mime, size, and for images width and height. Put the url in a block's image prop or an image field of a collection entry.

Files can be up to 15 MB: JPG, PNG, WebP, GIF, AVIF, SVG, PDF, MP4 and WebM. Larger files get 413 too_large, other types 415 unsupported_media_type.

Alt text

Alt text is what screen readers and search engines read. Set it when you upload, or later with PATCH /sites/{siteId}/media/{mediaId} and { "alt": "…" }. Describe what the picture shows, not that it is a picture.

Find and delete

GET /sites/{siteId}/media lists files newest first (up to 500). Search with q, filter with type. DELETE /sites/{siteId}/media/{mediaId} deletes a file; pages that still use it show nothing in its place, so change those first.