Hi everyone,
I’m trying to modify the theme.liquid
file using the Shopify Admin API but keep encountering a 404 Not Found error.
API Request I’m Using:
Request:
PUT /admin/api/2025-04/themes/{{theme_id}}/assets.json
Headers:
* `X-Shopify-Access-Token: {{access_token}}`
* `Content-Type: application/json`
Payload
{
"asset": {
"key": "layout/theme.liquid",
"value": "<html>...<body data-custom='new-value'>...</body>...</html>"
}
}
also I tried to modify a section/snippet instead but same error.
What I've Already Checked:
🔹 File Path is Correct: I confirmed that layout/theme.liquid exists by fetching:
GET /admin/api/2025-04/themes/{{theme_id}}/assets.json?asset[key]=layout/theme.liquid
🔹 Theme ID is Correct: I verified the theme_id by listing all themes:
GET /admin/api/2025-04/themes.json
🔹 API Token Has Proper Scopes: read_themes and write_themes are present:
GET /admin/api/2025-04/access_scopes.json
🔹 Tried Multiple API Versions: 2024-10 ,2024-07, 2024-04 ,2025-04, 2025-01, unstable, but all return 404 Not Found.




Would love to hear from anyone who has successfully updated theme.liquid recently. Any insights or workarounds would be much appreciated as I need a solution ASAP.
Thanks in advance! 😊🚀