Skip to main content

Uninstall a Shopify app with an API request

Your app can uninstall itself from a store programmatically using the GraphQL Admin API. This is useful for cleaning up old installations without requiring the merchant to act.

If you're a merchant looking to uninstall an app from your store, refer to the Shopify Help Center instead.


Use the appUninstall mutation in the GraphQL Admin API to uninstall your app programmatically. Uninstalling an app triggers cleanup tasks in Shopify, including deleting any registered webhooks, script tags, and Shopify admin links. If an app is uninstalled during key rotation, then both the old and new access tokens will become unusable.

Caution

Uninstalling an app is an irreversible operation. Before you uninstall an app, make sure that you no longer need to make API calls for the store in which the app has been installed.


The following examples show how to uninstall a Shopify app from a store using the appUninstall mutation:

mutation {
appUninstall {
app {
id
}
userErrors {
field
message
}
}
}
curl -X POST \
https://{shop}.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation { appUninstall { app { id } userErrors { field message } } }"
}'
const response = await admin.graphql(`
mutation {
appUninstall {
app {
id
}
userErrors {
field
message
}
}
}
`);

const { data } = await response.json();

if (data.appUninstall.userErrors.length > 0) {
console.error("Errors:", data.appUninstall.userErrors);
} else {
console.log("App uninstalled:", data.appUninstall.app.id);
}
query = <<~QUERY
mutation {
appUninstall {
app {
id
}
userErrors {
field
message
}
}
}
QUERY

response = client.query(query: query)

if response.body["data"]["appUninstall"]["userErrors"].any?
puts "Errors: #{response.body["data"]["appUninstall"]["userErrors"]}"
else
puts "App uninstalled: #{response.body["data"]["appUninstall"]["app"]["id"]}"
end

A successful response returns the uninstalled app's ID. If the mutation fails, check the userErrors array for details.


Was this page helpful?