Write a theme file by path
Creates or replaces a file at path (e.g. layouts/default.liquid, public/css/theme.css,
public/images/home/welcome.png). Send text as body, or any file as Base64 data.
The API decides how the file is stored, so clients never pick:
- Outside
public/: always a template (ThemeTemplateresponse). public/CSS/JS up to 65,535 bytes (UTF-8, not*.min.css/*.min.js): an editable template.- Anything else under
public/(images, fonts, vendor builds, bigger CSS/JS): an uploaded file (ThemeAssetresponse, withpath). - A template that grows past the limit becomes an uploaded file at the same path. An uploaded file only
becomes a template through
POST /themes/{theme_id}/files/editable.
A path is either a template or an uploaded file, never both. Files under public/ are served at
/themes/{theme_id}/public/<path after public/> on the assets host.
/themes/{theme_id}/files/{path}AuthorizationBearer token (JWT) · headerrequiredtheme_idstringrequiredpathstringrequiredFile path in the theme, slashes included (not URL-encoded)
application/jsonbodystringFile content as UTF-8 text
datastringFile content, Base64 encoded (a data: URI prefix is accepted)
File replaced (it may have moved from template to uploaded file)
_linksHalLinksidstringfile_namestringpathstringbodystringFull template source code
is_sectionbooleanschemaobjectPresent only when is_section is true — the section's configurable schema.
parent_commitstring | nullupdated_onstring<date-time>warningsobject[]Problems of the template the storefront would only show when the page renders, for an editor to show right
after saving. They never block saving. Present when a single template is returned (not in the templates listed
with a theme). Checked: Liquid syntax (with the storefront's own tags), a layout without
{% bolder_header %} / {% bolder_footer %}, literal asset_url files the theme does not have, and literal include / include_partial templates it does not have.
Show propertiesHide properties
objectseveritystringerrorwarningcodestringsyntaxlayout_headerlayout_footermissing_assetmissing_includemessagestringlineintegerLine of the template, when known.
_linksHalLinksidstringfile_namestringpathstringPath in the theme, including its public/ folder for v2 files (just file_name for legacy flat assets)
content_typestringfile_sizeintegerdigeststringurlstringCDN URL for this asset
updated_onstring<date-time>File created
_linksHalLinksidstringfile_namestringpathstringbodystringFull template source code
is_sectionbooleanschemaobjectPresent only when is_section is true — the section's configurable schema.
parent_commitstring | nullupdated_onstring<date-time>warningsobject[]Problems of the template the storefront would only show when the page renders, for an editor to show right
after saving. They never block saving. Present when a single template is returned (not in the templates listed
with a theme). Checked: Liquid syntax (with the storefront's own tags), a layout without
{% bolder_header %} / {% bolder_footer %}, literal asset_url files the theme does not have, and literal include / include_partial templates it does not have.
Show propertiesHide properties
objectseveritystringerrorwarningcodestringsyntaxlayout_headerlayout_footermissing_assetmissing_includemessagestringlineintegerLine of the template, when known.
_linksHalLinksidstringfile_namestringpathstringPath in the theme, including its public/ folder for v2 files (just file_name for legacy flat assets)
content_typestringfile_sizeintegerdigeststringurlstringCDN URL for this asset
updated_onstring<date-time>Unauthorized
Access denied
Validation error (both or neither of body/data, invalid Base64, invalid path or file type, unknown field)