Media folders
The folders of the media library — a tree reshaped with :move. A file’s folder is the folder_id on the file itself.
List media folders
A folder of the media library. Folders are a tree: parent_id names the one above, path, level and sort_order are maintained by the server, and the shape is changed with :move rather than by writing those fields. A file's folder is the folder_id on the file itself.
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: path asc. Sortable: display_name, level, parent_id, path, sort_order.
filterAIP-160 subset (§8). Filterable: display_name, key, level, parent_id, path. A field outside the list is INVALID_ARGUMENT.
List media folders › Responses
One page of media_folders.
This page of media_folders, 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 folder
A folder of the media library. Folders are a tree: parent_id names the one above, path, level and sort_order are maintained by the server, and the shape is changed with :move rather than by writing those fields. A file's folder is the folder_id on the file itself.
path Parameters
website_idId of the parent website.
Create media folder › Request Body
display_nameThe folder's name, as the media library shows it.
parent_idThe folder this one sits in; empty at the root. Settable on create and immutable afterwards — moving a folder is :move.
Create media folder › 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).
display_nameThe folder's name, as the media library shows it.
parent_idThe folder this one sits in; empty at the root. Settable on create and immutable afterwards — moving a folder is :move.
pathThe folder's position in the tree, as the ids of its ancestors and its own. Sorting by it renders the whole tree in one page, which is why it is the default order.
sort_orderThe folder's position among its siblings. Set by :move, never by a write.
levelHow deep the folder sits, counting the root as 0. Server-maintained with the rest of the tree bookkeeping.
keyWhat a default folder is found by. The library keeps a folder at its root for the product pictures (catalog_product), the category pictures (catalog_category), the pages and blocks (cms), the blog (blog) and the theme (theme), each made when its module is turned on — find one with filter=key = "catalog_product", not by its name, which may change. Set by the server and kept through a rename or a move; absent on a folder you made. A default folder may be deleted: it is made again the next time its module is set up.
Get media folder
A folder of the media library. Folders are a tree: parent_id names the one above, path, level and sort_order are maintained by the server, and the shape is changed with :move rather than by writing those fields. A file's folder is the folder_id on the file itself.
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 folder › 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).
display_nameThe folder's name, as the media library shows it.
parent_idThe folder this one sits in; empty at the root. Settable on create and immutable afterwards — moving a folder is :move.
pathThe folder's position in the tree, as the ids of its ancestors and its own. Sorting by it renders the whole tree in one page, which is why it is the default order.
sort_orderThe folder's position among its siblings. Set by :move, never by a write.
levelHow deep the folder sits, counting the root as 0. Server-maintained with the rest of the tree bookkeeping.
keyWhat a default folder is found by. The library keeps a folder at its root for the product pictures (catalog_product), the category pictures (catalog_category), the pages and blocks (cms), the blog (blog) and the theme (theme), each made when its module is turned on — find one with filter=key = "catalog_product", not by its name, which may change. Set by the server and kept through a rename or a move; absent on a folder you made. A default folder may be deleted: it is made again the next time its module is set up.
Delete media folder
A folder of the media library. Folders are a tree: parent_id names the one above, path, level and sort_order are maintained by the server, and the shape is changed with :move rather than by writing those fields. A file's folder is the folder_id on the file itself.
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 folder › Responses
Deleted. No body (§7).
Update media folder
A folder of the media library. Folders are a tree: parent_id names the one above, path, level and sort_order are maintained by the server, and the shape is changed with :move rather than by writing those fields. A file's folder is the folder_id on the file itself.
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 folder › Request Body
display_nameThe folder's name, as the media library shows it.
Update media folder › 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).
display_nameThe folder's name, as the media library shows it.
parent_idThe folder this one sits in; empty at the root. Settable on create and immutable afterwards — moving a folder is :move.
pathThe folder's position in the tree, as the ids of its ancestors and its own. Sorting by it renders the whole tree in one page, which is why it is the default order.
sort_orderThe folder's position among its siblings. Set by :move, never by a write.
levelHow deep the folder sits, counting the root as 0. Server-maintained with the rest of the tree bookkeeping.
keyWhat a default folder is found by. The library keeps a folder at its root for the product pictures (catalog_product), the category pictures (catalog_category), the pages and blocks (cms), the blog (blog) and the theme (theme), each made when its module is turned on — find one with filter=key = "catalog_product", not by its name, which may change. Set by the server and kept through a rename or a move; absent on a folder you made. A default folder may be deleted: it is made again the next time its module is set up.
Move (media folder)
Moves a folder inside the library's tree. Send {"parent_id": ..., "after_id": ...}: parent_id absent or null means the root, after_id absent or null means first among its new siblings. The move is what rewrites path, level and sort_order, which is why parent_id is immutable on Update.
path Parameters
website_idId of the parent website.
idId of the media_folders resource this URL addresses.
Move (media folder) › Request Body optional
Move (media folder) › Responses
The affected resource, or the method’s own response object (§10).