Admin API "Asset" PUT method - Create a section file not working

Topic summary

Main issue: Creating or updating a theme section file via the Shopify Admin REST Assets API fails. The error occurs when calling the SDK method await asset.save({ update: true }) to PUT a file into the sections directory.

Technical context: Code sets theme_id, asset.key = ‘sections/test-section.liquid’, and asset.value, then attempts a save/update. The request returns a non-successful response; the failing line is explicitly the save with update: true. The code snippet is central to the issue.

Community feedback: Multiple developers report the same behavior when using PUT to create/update assets in sections. One user confirms an identical failure path with update: true.

Workaround and actions: A workaround is shared via a linked community post. The poster has contacted Shopify Partner Support and recommends others file support tickets to help prioritize a fix.

Status: Unresolved/ongoing. No official fix is confirmed. Open questions remain about whether this is an SDK bug with asset.save(update) or an API-side regression affecting Assets in the sections folder.

Summarized with AI on January 5. AI used: gpt-5.

Hello!

I’m trying to test this endpoint to create a file in the sections folder of a selected theme. But I keep getting a non successful response.

This is the endpoint I’m working on:

app.put('/api/sections/install', async (_req, res) => {
  try {
    const session = res.locals.shopify.session
    const asset = new shopify.api.rest.Asset({ session: session })
    asset.theme_id = 97567768712
    asset.key = 'sections/test-section.liquid'
    asset.value = '# This is a test section created from api'
    await asset.save({
      update: true,
    })
    res.status(200).send({ value: asset.value, id: asset.theme_id })
  } catch (error) {
    res.status(400).send({ message: error.message })
  }
})

The portion of the code that is causing the error is:

await asset.save({
  update: true,
})

Please help, I have spent hours trying and searching for an answer but not getting anywhere.

Thank you in advance,

Having a similar issue here, but with saving order updates. Any help out there???

I have exact similar issue. I want to update the file so that I use PUT request of asset api and i face the error with this portion
await asset.save({
update: true,
}) ;

have you found any solution? @dannyelo

Hi @dannyelo ,

Seems that we have a similar problem. I have posted a workaround while we’re waiting for them to fix this. I have reached out to the Shopify Partner regarding this issue and I do recommend you to send out a ticket as well.

Please refer to this link for the workaround:

https://community.shopify.com/post/2443997

Hope that helps!

1 Like