Get Theme File

🔒

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

📘

Public Request Parameters

Path Parameters

NameTypeRequiredDescriptionExample
theme_idStringYesThe unique ID of the theme.0af0d906-ab15-460e-99a5-a23e5c78b6e8

Query Parameters

NameTypeRequiredDescriptionExample
typeStringNoThe type of file to retrieve. Defaults to layout.layout
locationStringNoThe file's location. Defaults to theme.liquid.theme.liquid

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeDescriptionExample
idStringThe ID of the theme file.af02b274-2ac3-4f2f-af8f-d4430abfff9f
theme_idStringThe ID of the theme the file belongs to.0af0d906-ab15-460e-99a5-a23e5c78b6e8
typeStringThe type of the file.layout
locationStringThe file's location path.theme.liquid
remote_urlStringThe remote URL of the file.https://example.com/file.liquid
contentStringThe full content of the file.<html>...</html>

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "file number error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized

API Structure Overview

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