Theme assets
A theme's files: its templates (which sections each kind of page shows), its Liquid sections and snippets, stylesheets and settings.
Endpoints#
- GET
/themes/{theme_id}/assets.jsonList assets or get one - PUT
/themes/{theme_id}/assets.jsonCreate or update an asset - DELETE
/themes/{theme_id}/assets.jsonDelete an asset
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#
/themes/{theme_id}/assets.jsonread_themesWithout 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.
| Parameter | Description |
|---|---|
asset[key] | A file to get, like sections/announcement-strip.liquid or templates/product.json. |
curl "https://store.weftgrid.com/api/admin/2026-10/themes/$THEME_ID/assets.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"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#
/themes/{theme_id}/assets.jsonwrite_themesSaves 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.
{
"asset": {
"key": "assets/custom.css",
"value": ".announcement-strip { letter-spacing: 0.04em; }"
}
}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 responseShowHide
{
"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#
/themes/{theme_id}/assets.jsonwrite_themesDeletes 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.
| Parameter | Description |
|---|---|
asset[key] | The file to delete. |
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/themes/$THEME_ID/assets.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"message": "sections/announcement-strip.liquid was deleted"
}