Shopify theme API tutorial (2026): read every theme and theme file from your own Shopify app with the GraphQL Admin API - and see what happens when the app tries to change one. Even with write_themes on my own store, Shopify answers ACCESS_DENIED without an exemption. Then the approved route: checking which themes accept app blocks. Shopify app development series, episode 17 - everything shown is real, nothing skipped.

What you'll learn

  • Scope write_themes / read_themes
  • themes(roles: [MAIN]) + theme ids
  • theme.files with wildcards (the GraphQL theme assets API)
  • Read a file's content (and the JSON comment gotcha)
  • themeFilesUpsert → ACCESS_DENIED + the exemption
  • App block support: @app in the section schema
  • GraphQL aliases: one request for every theme

💻 Free source code for this episode: https://github.com/fayyaz315/shopify-app-development-2026/tree/ep17

3 quick fixes from this episode

Shopify Theme API: Why themeFilesUpsert Says ACCESS_DENIED

Shopify theme API (2026-10): my app has write_themes, on my own development store, and themeFilesUpsert still answers ACCESS_DENIED - edits need an exemption from Shopify. I tested all 8 theme writes: all denied. Reads still work, and app blocks are the approved way onto the storefront.

▶ 60-second video: https://youtube.com/shorts/-ONZZ07tN2k

Shopify App Blocks: Does This Theme Support Them? (App Block Schema)

Shopify app blocks (2026-10): a merchant can only add your app block where the theme allows it - the section's schema must list a block of type @app. Our app checks every theme in one GraphQL request: 8 of 9 themes yes, skeleton-theme-main no.

▶ 60-second video: https://youtube.com/shorts/TEaR3TpngEc

Shopify Theme Assets API in GraphQL: Read Any Theme File

Shopify theme assets API, the GraphQL way (2026-10): theme.files takes filename wildcards like templates/*.json, and returns each file's content. Gotcha: JSON templates start with a comment, so strip it before JSON.parse.

▶ 60-second video: https://youtube.com/shorts/gaSAg1F_OvQ

Step by step

Preview + intro (0:00)

In the next ten minutes, your app reads every theme in a store, and every file inside it. Then it tries to change one, and Shopify says no, so we find the way Shopify does want your app on the storefront. This is the Shopify theme API inside a real app.

Every theme in the store, which one is live, and whether it can hold an app block. This is episode seventeen of the Shopify app development series. Last time, fulfillments.

Today: themes. The full code is free on GitHub, and the link is in the description.

How themes work (0:39)

A quick picture first. A store has several themes. Exactly one is live, the rest are drafts.

Each theme is a set of files: JSON templates, liquid sections, snippets, settings. Every section ends with a schema, and that schema decides which blocks a merchant may add to it. And one special block type, at app, means: blocks from apps are welcome here.

Remember that, it matters later. The scope is write themes, which includes read themes. As before, I restarted the dev server and opened the app once to grant it.

List the themes (1:16)

The new Themes page. Nine themes on my development store, each with its role, its product section, and appBlockSupport. Horizon is the live theme.

In the API, its role is main. And one theme says not supported. Keep an eye on skeleton theme main, we'll open it later.

Notice four themes called Horizon. Names aren't unique, so your app should always work with the theme's id. And the product section isn't the same everywhere.

Dawn and Rise call it main product, Horizon and Savor call it product information, skeleton just product. The loader starts with one small query: the themes, with id, name, role and the last update. Want only the live one?

Pass roles, main. You'll see that in GraphiQL. The id looks like g i d, Shopify, online store theme, and a number.

That number is what the admin uses in its own theme links. When does an app read themes? To check which theme is live, to help support find a problem, or to see where your block can go.

Read theme files (2:28)

Below, the files of the selected theme. It starts with the live one, and a filename pattern: templates, star.json. The selected theme, the pattern and the open file all live in the page's address.

The loader reads them from the search params. Each file comes with its name, its size in bytes, and when it last changed. The page shows the size in kilobytes.

That's the theme's files connection. The filenames argument takes wildcards, so one pattern finds a whole folder. This is what replaced the old REST asset API.

Searching for the Shopify theme assets API? In GraphQL, this is it. Click the product template.

And the app reads its body. Notice the comment on top: Shopify says this file is auto-generated by the theme editor. To read a body, ask for one file by name, and spread on the text body type to get its content.

That comment breaks JSON.parse, by the way. So the app strips it first. Other patterns work the same way.

Sections star.liquid, snippets star, or config settings data.json, where the merchant's theme settings live.

Try to edit a theme (3:39)

Now the big question. Can our app change this file? I press save, and send it back with themeFilesUpsert.

The save sends themeFilesUpsert: the theme id, and a list of files, each with a filename and a body of type text. This is the mutation every theme editing tutorial shows you. Let's see what Shopify says in 2026.

Access denied. Shopify did not save it. The app needs write themes, and an exemption from Shopify, to modify theme files.

And we do have write themes. This is a development store I own. It still says no.

I tested every theme write: upsert, copy and delete files, duplicate, create, rename, publish and delete a theme. All eight: access denied. It's not a user error, either.

It comes back as a top-level GraphQL error, and the client throws. So the action catches it and shows the code. The page shows the code in a red banner, and cuts the message before the form link to keep it short.

Why? Code changes from apps can break a store's theme. So Shopify keeps theme edits for apps that are granted an exemption, and the error links a form to ask for one.

Coming up: the way Shopify does want your app on the storefront.

App block support (5:04)

Here's that way: app blocks. The merchant adds your block in the theme editor, and you never touch their code. But only where the theme allows it.

So let's open Horizon's product section: product information. Green. This section accepts app blocks.

Its schema lists exactly one block type: at app. The app pulls the schema out of the liquid file, and reads its block types. If a schema can't be parsed, the app treats it as no blocks, instead of crashing the page.

For a section file, the loader adds those block types, and the page picks a green or a yellow banner. Now skeleton theme main. Browse its files, and open its product section.

Yellow. No block types at all. A merchant on this theme can't add your app block to the product page.

That's what the app block column checks for every theme. The product template names its main section, and that section's schema must accept at app. And it's two requests for all nine themes, not eighteen.

GraphQL aliases, t zero, t one and so on, each read one file of one theme. First request: every theme's product template, to learn the main section's type. Second: that section file from every theme.

Want to practise? Run the same check for the collection template, or for every JSON template in the theme. Use a check like this in your onboarding, to tell a merchant whether their theme can show your block on the product page.

In the admin (6:36)

In Shopify's own admin, the same themes. Horizon live, the rest as drafts, skeleton theme main among them. Now GraphiQL.

Only the live theme: roles, main. Horizon, role main, with its id. You need that id for everything else.

Its first five JSON templates. File names, sizes in bytes, and when each changed. The page template's body.

The whole file as one string, comment included. And themeFilesUpsert, a free shipping snippet on the live theme. Same answer straight from the API.

Access denied, with the link to the exemption request.

Honest notes (7:16)

A few honest notes before the recap. One: I planned an episode about editing themes from your app. Shopify said no, so this is the honest version.

Two: our check looks at the product page only. Other templates can be different. Three: the theme editor buttons are only links into Shopify's admin.

Our app doesn't edit anything. And everything you saw was tested on my real development store, on API version 2026-10, before I pressed record.

Recap (7:48)

So, the recap. Add the themes scope. Read themes, their files with wildcards, and any file's content.

Writing to a theme needs an exemption from Shopify, even on your own store. So check the schema for at app, and let merchants add your app block. That's the Shopify theme API in 2026, inside a real app, on a real store.

The full code for this episode is free on GitHub. The link is in the description. Next episode: a theme app extension.

We build the app block itself. See you there.

📖 The full written tutorial with every episode: https://www.wixob.com/shopify-theme-api-tutorial/
📚 Course page: https://www.wixob.com/shopify-app-development-2026/
🔔 New episodes on YouTube: https://www.youtube.com/@fayyaz-ahmed-shopify-developer?sub_confirmation=1

Questions about the Shopify GraphQL Admin API? Ask in the comments — I answer every one.