Update Theme File

Update the content of a specific theme file in the selected theme.

🔒

Requires write_themes access scope. More access scope

The Update Theme File API allows developers to modify the content of an existing documentation file within a specific theme.

This API is especially useful for:

  1. Modifying existing template files to implement new design changes
  2. Updating snippet files with improved or additional functionality

Request Parameters

Public Request Parameters

📘

Path Parameters

ParameterTypeRequiredExampleDescription
theme_idstringYes1500021b-88ed-4750-bbc5-97ec98351dc0Theme's unique identifier.

Body Parameters

Parameter

Type

Required

Description

Example

doc

object

Yes

The document object containing update details

{...}

doc.type

string

Yes

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

'layout'

doc.location

string

Yes

The path location of the file to update within the theme

'templates/custom.liquid'

doc.content

string

Yes

The new content to replace in the specified file

'<!DOCTYPE html>...'

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"success"Status code of the response
messagestring"OK"Descriptive message of the response

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!