Access denied for themeFilesUpsert GQL Admin Api

Hi there,

The Shopify app I’m building is having issues with the themeFilesUpsert mutation:

https://shopify.dev/docs/api/admin-graphql/2025-01/mutations/themeFilesUpsert

I’ve already had my exemption request approved, which is necessary from Shopify to use the mutation, and I

I already have access to the scope for write_themes, which my app requests when installing the Shopify app.

These are all of the scopes that are requested to have access granted by the Shopify store:

‘read_checkout_branding_settings,read_content,write_content,read_online_store_pages,unauthenticated_read_metaobjects,read_metaobjects,write_metaobjects,read_metaobject_definitions,write_metaobject_definitions,read_products,read_themes,write_themes’

However, with all of this, I’m still getting a denied error in my console, preventing me from using the mutation:

“Access denied for themeFilesUpsert field. Required access: The user needs write_themes and an exemption from Shopify to modify theme files. If you think that your app is eligible for an exemption and should have access to this API, then you can [submit an exception request].”

This is my GQL Admin Api mutation:

const query = `
	mutation themeFilesUpsert($files: [OnlineStoreThemeFilesUpsertFileInput!]!, $themeId: ID!) {
		themeFilesUpsert(files: $files, themeId: $themeId) {
			upsertedThemeFiles {
				filename
			}
			userErrors {
				field
				message
			}
		}
	}
`;

const variables = {
	themeId,
	files: [
		{
			filename: `templates/${templateDB[0].fileType}.${templateDB[0].templateSuffix}.liquid`,
			body: {
				type: 'TEXT',
				value: templateDB[0].html
			}
		}
	]
};

Is there any insight on how to fix this denied error?

Thank you

I’m having the exact same problem. I’ve been granted access to the scope after submitting the request form. But despite being told it’s been applied, I’m seeing this, over and over again:

GraphqlQueryError:
“Access denied for themeFilesUpsert field. Required access: The user needs write_themes and an exemption from Shopify to modify theme files.”

I’m also having this exact issue. Any one from Shopify willing to help?

I am also having the same issue, Despite being granted the scope, i am seeing the same error, and when i asked them on the email, that i am not seeing any changes, they replied

Hi Aakash,

Thank you for reaching out. This confirms that we have successfully added the Theme API exemption to your app.

The changes are effective immediately and require no waiting period for population.

Regarding your concern about the ‘access denied’ error: As troubleshooting specific development issues falls outside our scope of support, we recommend you contact our Partner Support Team. They possess the necessary expertise to assist with app development issues.

I don’t know why support for devs is so lame here. Come on Shopify, you can do better on the dev side too.

I have the same issue as well. I had the Theme API exemption request approved a couple weeks ago but I am still getting the ‘Access denied for themeFilesUpsert field.’ error. Support verified that the exemption is applied and my app scopes do include the ‘write_themes’.

Anyone managed to resolve this?