Media Library

Upload a media asset

Changed on

Upload a file into the library. Dedup by checksum returns the existing asset.

post/api/v1/media

Request

Request body multipart/form-data

filestring binary required
contextstring required

Upload context id, e.g. 'pwa.logo' or 'uncategorized'.

folderIdstring uuid nullable

Response

Successful Response

idstring uuid required
kind'image' | 'video' required
filenamestring required
urlstring required

Public URL of the original.

contentTypestring nullable

Sniffed content type, not client-declared.

sizeBytesinteger required
widthinteger nullable
heightinteger nullable
durationMsinteger nullable

Video duration; null in v1 (no ffmpeg).

lqipstring nullable

~20px blurred data-URI for next/image placeholder='blur'.

folderIdstring uuid nullable

null = library root.

originContextstring required

Full upload context, e.g. 'pwa.logo' or 'uncategorized'.

sectionstring required

Derived from originContext prefix; the picker's default facet.

tagsstring[]
isArchivedboolean
sourceAssetIdstring uuid nullable

Root/source asset for a crop or slice; null for uploads.

sourceOpobject nullable

Transform provenance, e.g. {'type':'crop','rect':{...}}.

createdAtstring date-time required
updatedAtstring date-time nullable

Changes

    • warning

      added the new DOMAIN_PURCHASE_INSUFFICIENT_FUNDS enum value to the / response property for the response status

    • warning

      added the new DOMAIN_PURCHASE_INSUFFICIENT_FUNDS enum value to the / response property for the response status

    • warning

      added the new DOMAIN_PURCHASE_INSUFFICIENT_FUNDS enum value to the / response property for the response status

    • breaking

      the request property contentMediaType changed from to application/octet-stream

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      the request property format was generalized from binary to no format