Media files
The image library: multipart upload, and the read that serves a stored file transformed on the fly — w, h, crop, q and fmt are the whole vocabulary, and it is the same URL a rendered site fetches. :usages says where a file is used, and :unused lists the files nothing uses.
List media files
A file in the website's media library. Create is a multipart/form-data upload — everything but alt_text, title and folder_id is read off the file itself — and the bytes come back from GET /engine-api/v1/websites/{website_id}/media/{id}, which resizes and re-encodes on the fly — the same URL a rendered page asks for.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: create_time, filename, folder_id, is_image, mime_type, original_filename.
filterAIP-160 subset (§8). Filterable: alt_text, create_time, filename, folder_id, is_image, mime_type, original_filename, title. A field outside the list is INVALID_ARGUMENT.
List media files › Responses
One page of media.
This page of media, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create media file
A file in the website's media library. Create is a multipart/form-data upload — everything but alt_text, title and folder_id is read off the file itself — and the bytes come back from GET /engine-api/v1/websites/{website_id}/media/{id}, which resizes and re-encodes on the fly — the same URL a rendered page asks for.
path Parameters
website_idId of the parent website.
Create media file › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
filenameThe name the file is stored under, made unique on upload. This is the one that appears in the URL.
original_filenameThe name the file arrived with, kept so a person can recognise their own upload.
mime_typeThe stored file's media type, detected on upload. filter=mime_type:"image/" is how you ask for pictures by family.
storage_pathWhere the bytes live in the platform's object store. Internal bookkeeping — fetch the file through its media URL, not through this.
file_sizeSize of the stored original, in bytes. A transformed variant is smaller and is not counted here.
is_imageWhether the file is an image, and therefore whether the w/h/crop/q/fmt transforms apply to it.
widthWidth of the stored original in pixels. Meaningful only when is_image is true.
heightHeight of the stored original in pixels. Meaningful only when is_image is true.
alt_textThe alternative text rendered with the picture. It is what a screen reader announces, so it belongs on every image that carries meaning.
titleA human label for the file in the media library.
folder_idThe media_folders resource this file sits in. filter=folder_id = null is the library's root.
Get media file
A file in the website's media library. Create is a multipart/form-data upload — everything but alt_text, title and folder_id is read off the file itself — and the bytes come back from GET /engine-api/v1/websites/{website_id}/media/{id}, which resizes and re-encodes on the fly — the same URL a rendered page asks for.
path Parameters
website_idId of the parent website.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get media file › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
filenameThe name the file is stored under, made unique on upload. This is the one that appears in the URL.
original_filenameThe name the file arrived with, kept so a person can recognise their own upload.
mime_typeThe stored file's media type, detected on upload. filter=mime_type:"image/" is how you ask for pictures by family.
storage_pathWhere the bytes live in the platform's object store. Internal bookkeeping — fetch the file through its media URL, not through this.
file_sizeSize of the stored original, in bytes. A transformed variant is smaller and is not counted here.
is_imageWhether the file is an image, and therefore whether the w/h/crop/q/fmt transforms apply to it.
widthWidth of the stored original in pixels. Meaningful only when is_image is true.
heightHeight of the stored original in pixels. Meaningful only when is_image is true.
alt_textThe alternative text rendered with the picture. It is what a screen reader announces, so it belongs on every image that carries meaning.
titleA human label for the file in the media library.
folder_idThe media_folders resource this file sits in. filter=folder_id = null is the library's root.
Delete media file
A file in the website's media library. Create is a multipart/form-data upload — everything but alt_text, title and folder_id is read off the file itself — and the bytes come back from GET /engine-api/v1/websites/{website_id}/media/{id}, which resizes and re-encodes on the fly — the same URL a rendered page asks for.
path Parameters
website_idId of the parent website.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete media file › Responses
Deleted. No body (§7).
Update media file
A file in the website's media library. Create is a multipart/form-data upload — everything but alt_text, title and folder_id is read off the file itself — and the bytes come back from GET /engine-api/v1/websites/{website_id}/media/{id}, which resizes and re-encodes on the fly — the same URL a rendered page asks for.
path Parameters
website_idId of the parent website.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update media file › Request Body
alt_textThe alternative text rendered with the picture. It is what a screen reader announces, so it belongs on every image that carries meaning.
titleA human label for the file in the media library.
folder_idThe media_folders resource this file sits in. filter=folder_id = null is the library's root.
Update media file › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
filenameThe name the file is stored under, made unique on upload. This is the one that appears in the URL.
original_filenameThe name the file arrived with, kept so a person can recognise their own upload.
mime_typeThe stored file's media type, detected on upload. filter=mime_type:"image/" is how you ask for pictures by family.
storage_pathWhere the bytes live in the platform's object store. Internal bookkeeping — fetch the file through its media URL, not through this.
file_sizeSize of the stored original, in bytes. A transformed variant is smaller and is not counted here.
is_imageWhether the file is an image, and therefore whether the w/h/crop/q/fmt transforms apply to it.
widthWidth of the stored original in pixels. Meaningful only when is_image is true.
heightHeight of the stored original in pixels. Meaningful only when is_image is true.
alt_textThe alternative text rendered with the picture. It is what a screen reader announces, so it belongs on every image that carries meaning.
titleA human label for the file in the media library.
folder_idThe media_folders resource this file sits in. filter=folder_id = null is the library's root.
Download media file
Serves a stored file, transformed on the fly. w and h fit the image inside a box; add crop=1 to fill the box exactly and centre-crop the overflow; q sets the quality and fmt the output format. Every variant is derived from the original and cached, so asking for the size you will display costs nothing extra and is what a rendered page already does.
This is the one route of the engine surface the platform publishes, and it is unauthenticated by design: it is the URL a browser fetches from a public page.
path Parameters
website_idId of the parent website.
idId of the media resource this URL addresses.
query Parameters
wTarget width in pixels (max 4096).
hTarget height in pixels (max 4096).
cropOutput exactly w×h, centre-cropping the overflow, instead of fitting inside the box. Needs both dimensions; only 1 and true enable it.
qOutput quality, 1–100.
fmtOutput format. Defaults to the stored format.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Download media file › Responses
The stored bytes.
Usages (media file)
Where this file is used: the records of the website that name it — a product's or a category's picture, a post's cover, an author's avatar, a page's background, a theme's logo or favicon. A GET custom method, because it is a read no List filter can express (§10).
One entry per record, each once: resource_type is the record's collection (catalog_products, catalog_categories, blog_posts, blog_authors, cms_pages, themes), resource_id its id and display_name its name. A per-view version of a post or a page, and a page's customer-group version, is reported as the post or the page it belongs to. sole_picture is true on a product whose only picture this file is — deleting the file leaves it with none. Entries are ordered by resource_type, then display_name; total_size counts them, and an unused file answers an empty usages. A file named only inside an HTML body or in a theme's custom CSS is not reported.
path Parameters
website_idId of the parent website.
idId of the media resource this URL addresses.
Usages (media file) › Responses
The method’s own response object (§10).
Unused (media files)
The files of the library that no record of the website names — no product, category, post, author, page or theme — the ones that can go without leaving anything without its picture. A GET custom method, because "named by nothing" is a read no List filter can express (§10).
The answer is a page of media exactly as the List's: the same page_size, page_token, skip, filter and order_by, create_time desc unless told otherwise, {"media": […]} with next_page_token and total_size. Folders do not narrow it — the whole library is asked, unless filter names a folder_id. A file named only inside an HTML body or in a theme's custom CSS counts as unused here, as it is unreported by :usages.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: create_time, filename, folder_id, is_image, mime_type, original_filename.
filterAIP-160 subset (§8). Filterable: alt_text, create_time, filename, folder_id, is_image, mime_type, original_filename, title. A field outside the list is INVALID_ARGUMENT.
Unused (media files) › Responses
One page of media (§8), cut as :unused says.
This page of media, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.