--- title: Uninstall a Shopify app with an API request description: Uninstall a Shopify app from a store using the appUninstall GraphQL mutation. source_url: html: >- https://shopify.dev/docs/apps/build/authentication-authorization/app-installation/uninstall-app-api-request md: >- https://shopify.dev/docs/apps/build/authentication-authorization/app-installation/uninstall-app-api-request.md --- # Uninstall a Shopify app with an API request Your app can uninstall itself from a store programmatically using the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). 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](https://help.shopify.com/manual/apps/working-with-apps#uninstall-an-app) instead. *** ## How it works Use the [`appUninstall`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/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](https://shopify.dev/docs/apps/build/authentication-authorization/client-secrets/rotate-revoke-client-credentials), then both the old and new [access tokens](https://shopify.dev/docs/apps/build/authentication-authorization/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. *** ## Examples The following examples show how to uninstall a Shopify app from a store using the `appUninstall` mutation: ##### GraphQL mutation ```graphql mutation { appUninstall { app { id } userErrors { field message } } } ``` ##### cURL ```bash 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 } } }" }' ``` ##### JavaScript ```javascript 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); } ``` ##### Ruby ```ruby 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. ***