**Version: 202607**

# Theme File

Read and write a theme's files, file version history, and custom templates

Theme files are the layouts, templates, sections, snippets, assets, configs, and locale files that make up a theme. Reading and writing files corresponds to the code editor in the admin; these endpoints work on a theme directly and do not need an edit session.

Provides endpoints to browse a theme's file tree, create, read, update, rename, and delete files, inspect file version history, and manage custom templates bound to products, collections, and pages.

- [Get theme file tree](/api/theme-doc-tree) `GET /openapi/2026-07/themes/:theme_id/doctree`: Get the file tree of the specified theme.

- [Get theme file](/api/theme-doc-file) `GET /openapi/2026-07/themes/:theme_id/doc`: Retrieve details of a specific theme's doc file using its unique identifier

- [Create theme file](/api/theme-doc-create) `POST /openapi/2026-07/themes/:theme_id/doc`: Creates a new file within the specified theme.

- [Delete theme file](/api/theme-doc-delete) `DELETE /openapi/2026-07/themes/:theme_id/doc`: Delete a specific theme file by theme ID, file type, and file location. `assets/theme.css` and

- [Update theme file](/api/theme-doc-patch) `PATCH /openapi/2026-07/themes/:theme_id/doc`: Replace the whole content of the specified file. Changes to the default theme's files take

- [Rename theme file](/api/theme-doc-rename) `PUT /openapi/2026-07/themes/:theme_id/doc-rename`: Renames an existing file within the specified theme.

- [List versions of all theme files](/api/theme-doc-version) `GET /openapi/2026-07/themes/:theme_id/doc/version-records`: Returns the version history for all files in the specified theme.

- [List versions of a theme file](/api/theme-doc-versions) `GET /openapi/2026-07/themes/:theme_id/doc/versions`: Returns the version history for a single theme file.

- [Get theme file version](/api/theme-doc-version-detail) `GET /openapi/2026-07/themes/:theme_id/doc/versions/:version_id`: Retrieves a specific version of a theme file by its version ID.

- [List theme custom templates](/api/theme-templates-list) `GET /openapi/2026-07/themes/:theme_id/theme-templates`: List the custom templates bound to products, collections, or custom pages.

- [Create theme custom template](/api/theme-templates-create) `POST /openapi/2026-07/themes/:theme_id/theme-templates`: Create a custom template and bind it to objects (products, collections) in one call; with empty

- [Delete theme custom template](/api/theme-templates-delete) `DELETE /openapi/2026-07/themes/:theme_id/theme-templates/:template_id`: Delete a custom template within the specified theme.

- [Update theme custom template](/api/theme-templates-update) `PATCH /openapi/2026-07/themes/:theme_id/theme-templates/:template_id`: Update the bindings (products, collections) of an existing template. `relations` replaces the
