Skip to main content
GET
/
api
/
v1
/
themes
/
{theme_id}
/
assets.json
Theme Assets
curl --request GET \
  --url https://api.launchmystore.io/api/v1/themes/{theme_id}/assets.json \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "<string>",
  "value": "<string>",
  "attachment": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Theme Assets

Manage files within a theme including templates, sections, snippets, and static assets.

List Assets

Returns a list of all asset files in a theme.

Request

curl -X GET "https://api.launchmystore.io/api/v1/themes/theme_abc123/assets.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Parameters

key_prefix
string
Filter assets by key prefix (e.g., sections/, assets/)

Response

{
  "success": true,
  "data": {
    "items": [
      {
        "key": "layout/theme.liquid",
        "public_url": null,
        "content_type": "text/x-liquid",
        "size": 4523,
        "created_at": "2024-01-15T10:00:00Z",
        "updated_at": "2024-03-15T14:30:00Z"
      },
      {
        "key": "sections/header.liquid",
        "public_url": null,
        "content_type": "text/x-liquid",
        "size": 8192,
        "created_at": "2024-01-15T10:00:00Z",
        "updated_at": "2024-03-10T09:00:00Z"
      },
      {
        "key": "assets/theme.css",
        "public_url": "https://cdn.launchmystore.io/themes/theme_abc123/assets/theme.css",
        "content_type": "text/css",
        "size": 45678,
        "created_at": "2024-01-15T10:00:00Z",
        "updated_at": "2024-03-12T11:30:00Z"
      }
    ]
  }
}

Get Asset

Retrieve a single asset file including its content.

Request

curl -X GET "https://api.launchmystore.io/api/v1/themes/theme_abc123/assets.json?key=sections/header.liquid" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Parameters

key
string
required
The asset key/path (e.g., sections/header.liquid, assets/theme.css)

Response

{
  "success": true,
  "data": {
    "key": "sections/header.liquid",
    "value": "{% comment %}Header Section{% endcomment %}\n<header class=\"header\">\n  ...\n</header>\n\n{% schema %}\n{\n  \"name\": \"Header\",\n  \"settings\": [...]\n}\n{% endschema %}",
    "content_type": "text/x-liquid",
    "size": 8192,
    "created_at": "2024-01-15T10:00:00Z",
    "updated_at": "2024-03-10T09:00:00Z"
  }
}

Create/Update Asset

Create a new asset or update an existing one.

Request

curl -X PUT "https://api.launchmystore.io/api/v1/themes/theme_abc123/assets.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "snippets/custom-banner.liquid",
    "value": "<div class=\"custom-banner\">\n  {{ section.settings.text }}\n</div>"
  }'

Body Parameters

key
string
required
Asset path (e.g., snippets/custom-banner.liquid, assets/custom.css)
value
string
Asset content (for text files). Required unless using attachment.
attachment
string
Base64-encoded file content (for binary files like images). Required unless using value.

Response

{
  "success": true,
  "data": {
    "key": "snippets/custom-banner.liquid",
    "value": "<div class=\"custom-banner\">\n  {{ section.settings.text }}\n</div>",
    "content_type": "text/x-liquid",
    "size": 67,
    "created_at": "2024-03-20T10:00:00Z",
    "updated_at": "2024-03-20T10:00:00Z"
  }
}

Delete Asset

Delete an asset file from the theme.

Request

curl -X DELETE "https://api.launchmystore.io/api/v1/themes/theme_abc123/assets.json?key=snippets/custom-banner.liquid" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Parameters

key
string
required
The asset key/path to delete

Response

{
  "success": true,
  "data": {
    "key": "snippets/custom-banner.liquid",
    "deleted": true
  }
}

Asset Paths

Common asset paths:
Path PatternDescription
layout/*.liquidLayout templates
templates/*.jsonPage templates
sections/*.liquidSection files
snippets/*.liquidSnippet files
assets/*Static files (CSS, JS, images)
config/settings_schema.jsonTheme settings schema
config/settings_data.jsonTheme settings values
locales/*.jsonTranslation files

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
FORBIDDENApp doesn’t have write_themes scope
NOT_FOUNDTheme or asset does not exist
VALIDATION_ERRORInvalid asset key or content
PROTECTED_ASSETCannot modify protected system file