Skip to main content
PUT
Create / Update Theme Asset
Creates a theme file or replaces its contents. This is an upsert keyed by key — writing the same key again overwrites the file. Auth: OAuth access token with the write_themes scope.
Everything this endpoint does is also available in your dashboard under the theme code editor, with no app or access token required. Use the API when you are automating theme changes from an app; use the editor for one-off edits to your own store.
Writes apply to the theme you name in theme_id, and take effect immediately if that theme is the live one. To work safely, duplicate your theme first and write to the copy — only the active theme is served to customers.

Path Parameters

string
required
The theme ID

Body Parameters

string
required
Asset path within the theme, e.g. snippets/custom-banner.aqua, templates/page.landing.json, assets/custom.css
string
required
The file’s text content
key goes in the body, not the query string. The query key parameter is used only by List and Delete.

Request

Response

The created or updated asset is nested under data.asset.

Errors

See also