Upload or replace one asset
Stores one file at key, replacing any file already there. Send the bytes as base64, or an importFromUrl for the server to fetch. The key is the path after /assets/ — for example photos/hero.webp or style.css. Do not prefix it with assets/ or /. Keys may not contain .. segments or start with .dotsy/. A single file may be up to 5 MB on the Free plan and 10 MB on a paid plan, and video and audio need a paid plan. HTML files are not accepted. Raster images (not SVG) are optimized on upload: they are re-encoded as WebP and, for the hero and column intents, get a smaller -800 variant, so the stored key can differ from the one you sent. Send optimize: false (?optimize=0 on the raw upload) to store the bytes as sent; animated GIFs are always kept as sent. To upload larger files without base64, send the raw bytes to assets-raw instead. Uploaded files are live in the editor and draft preview at once; the published site picks them up at the next publish.
Request
- Base URL: https://api.dotsy.ai
- URL: https://api.dotsy.ai/api/v1/sites/{slug}/assets/{key}
- Auth: HTTP bearer
Path parameters
Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.
Percent-encode each segment; '/' may be sent raw or as %2F. Keys may contain '/'.
Request body
Example request
{
"bodyBase64": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4=",
"contentType": "image/svg+xml"
}Response
An existing asset was replaced.
Example response
{
"key": "photos/hero.webp",
"originalKey": "photos/hero.jpg",
"contentType": "image/webp",
"suggestedSrcset": "photos/hero-800.webp 800w, photos/hero.webp 1600w"
}Changes
No recorded changes to this operation across all 1 revision of this API.