Skip to main content
POST
Upload an image, document or media file onto a review branch

Authorizations

X-API-Key
string
header
required

Company API key - scoped to a specific company. Generate from the Integrations page in your dashboard.

Path Parameters

websiteId
string
required

Body

application/json

Upload a website asset

companyId
string
required

Company ID that owns the website

branch
string
required

Review branch to read from or write to. Omit (or "main") to read the live site. To propose fixes, write files to a NEW branch name (e.g. "seo-optimizer-2026-09-03") — the branch is created on first write and is reviewed and approved by the owner. Writing to "main" is refused. Required here and must not be "main".

path
string

Where the file lives in the site, e.g. /assets/hero.jpg or /assets/files/sales-sheet.pdf. A bare file name lands in /assets/ (documents in /assets/files/). Defaults to the file name from sourceUrl. Raster images are optimized to WebP, so /assets/hero.jpg may be saved as /assets/hero.webp — use the returned path in links and [Image blocked: No description].

sourceUrl
string

Public http(s) URL to fetch the file from (preferred for images: no need to inline bytes). Private/internal addresses are refused. Send exactly one of sourceUrl or contentBase64.

contentBase64
string

The file bytes, base64-encoded (a data: URL prefix is accepted). Only for files you already hold locally; prefer sourceUrl.

Response

The stored file

path
string

Saved path — reference the file by this path

storage
string

'inline' (small file kept in the project) or 'object' (object storage)

bytes
integer

Stored size in bytes

contentType
string
sha256
string

Content hash (object-stored files)

width
integer

Image width, for the [Image blocked: No description] attribute

height
integer

Image height, for the [Image blocked: No description] attribute

optimized
boolean

True when an image was downscaled/re-encoded