Browse the API docs

Theme assets

A theme's files: its templates (which sections each kind of page shows), its Liquid sections and snippets, stylesheets and settings.

Endpoints#

Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.

List assets or get one#

GET/themes/{theme_id}/assets.jsonread_themes

Without asset[key], every file of the theme with its size and when it changed: sections, snippets and stylesheets, then templates/*.json (each template's sections) and config/settings_data.json (the theme's settings). With asset[key], that file with its value.

Query parameters
ParameterDescription
asset[key]A file to get, like sections/announcement-strip.liquid or templates/product.json.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/themes/$THEME_ID/assets.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "assets": [
    {
      "key": "sections/announcement-strip.liquid",
      "content_type": "text/x-liquid",
      "size": 1184,
      "checksum": "5f2b0f1d3c6e8a9b7d4c2e1f0a9b8c7d",
      "theme_id": "cm2theme0001",
      "created_at": "2026-10-20T09:12:00.000Z",
      "updated_at": "2026-10-24T16:40:00.000Z"
    }
  ]
}

Create or update an asset#

PUT/themes/{theme_id}/assets.jsonwrite_themes

Saves a file with the code editor's checks: Liquid must parse, a section needs a valid {% schema %}, stylesheets can't @import or load from anywhere but https:// and the store's uploads. Templates (templates/*.json) and config/settings_data.json are saved the way the theme editor saves them; unknown sections and settings are left out. source_key copies another asset. A change to the live theme shows on the storefront straight away. Fires themes/update.

Request body
{
  "asset": {
    "key": "assets/custom.css",
    "value": ".announcement-strip { letter-spacing: 0.04em; }"
  }
}
Request with curl
curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/themes/$THEME_ID/assets.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "asset": {
    "key": "assets/custom.css",
    "value": ".announcement-strip { letter-spacing: 0.04em; }"
  }
}'
Example responseShow
{
  "asset": {
    "key": "sections/announcement-strip.liquid",
    "value": "<div class=\"announcement-strip\">{{ section.settings.text }}</div>\n\n{% schema %}\n{ \"name\": \"Announcement strip\", \"settings\": [{ \"type\": \"text\", \"id\": \"text\", \"label\": \"Text\" }] }\n{% endschema %}\n",
    "content_type": "text/x-liquid",
    "size": 1184,
    "checksum": "5f2b0f1d3c6e8a9b7d4c2e1f0a9b8c7d",
    "theme_id": "cm2theme0001",
    "created_at": "2026-10-20T09:12:00.000Z",
    "updated_at": "2026-10-24T16:40:00.000Z"
  }
}

Delete an asset#

DELETE/themes/{theme_id}/assets.jsonwrite_themes

Deletes a section, snippet or stylesheet, or an alternate template (templates/product.gift.json) that no product, collection or page uses. Default templates, the home page and the settings can't be deleted. Fires themes/update.

Query parameters
ParameterDescription
asset[key]The file to delete.
Request
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/themes/$THEME_ID/assets.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "message": "sections/announcement-strip.liquid was deleted"
}