Get Theme File

Retrieve details of a specific theme's doc file using its unique identifier

🔒

Requires read_themes access scope. More access scope

The Get Theme File API retrieves the content of a specific theme file. This enables users to view or manipulate the file content of their selected theme.

This API is especially useful for:

  1. Retrieving theme-specific layout or template files.
  2. Accessing and updating theme file content.
  3. Verifying the structure and settings of theme files.

Request Parameters

Public Request Parameters

📘

Path Parameters

Parameter

Type

Required

Description

Example

theme_id

string

Yes

The unique identifier of the theme whose doc file you want to retrieve.

theme_123456789

type

string

No

The type of file to retrieve.
• Possible values:
- layout
- templates
- sections
- snippets
- assets
- config
- locales

Defaults to layout.

template

location

string

No

The file's location path. Defaults to theme.liquid.

templates/index.liquid

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"200"The response status code.
messagestring"Success"The response message.
data. theme_file.idstring"file_123456789"The ID of the retrieved theme file.
data. theme_file.theme_idstring"theme_123456789"The ID of the theme this file belongs to.
data. theme_file.typestring"layout"The type of the retrieved file.
data. theme_file.locationstring"theme.liquid"The path location of the file.
data. theme_file.remote_urlstring"https://example.com/ files/theme.liquid"The remote URL where the file can be accessed.
data.theme_file.contentstring"<!DOCTYPE html>..."The full content of the retrieved file.

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!