Ferndesk

Replace an asset in place

Replaces the bytes of an asset and keeps its id and URL, so every article, draft and setting that uses it shows the new file with no content edit and no review. The new file must have the same type. Identical bytes change nothing and answer replaced: false, so a retry is safe. Needs an owner or admin key.

PUT /v1/assets/{id}/content
Bearer token scope content:publish

Path parameters

· 1
id string required

Body

required application/json
filename string · min length: 1· max length: 255 required

File name, with its extension.

content_type string · min length: 1· max length: 255 required

MIME type of the file. A replacement must have the same type as the asset.

data_base64 string · min length: 1· max length: 4105264 required

The file, base64-encoded (not a data: URL; line breaks are ignored). Up to 3 MB decoded.

captured_at string · date-time · pattern

When the screenshot or recording was taken.

width integer · min: 1· max: 100000

Width in pixels.

height integer · min: 1· max: 100000

Height in pixels.

Responses