Create Theme File

🔒

Requires write_themes access scope. More access scope

The Create Theme File API allows developers to create a new documentation file within a specific theme in store. It enables you to add new layout templates, snippet files, or other document types to customize your theme's structure and functionality.

This API is especially useful for:

  1. Adding new template files to extend your theme's functionality.
  2. Creating custom snippet files for reusable components.
  3. Uploading new theme documentation files for better organization.
  4. Extending your theme's capabilities with additional file types.

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 file 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 where the file should be created.

'templates/custom.liquid'

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!