# Scopes The Scopes API provides the ability to dynamically manage your access scopes within an embedded context. > Tip: > To learn more about declaring and requesting access scopes, as well as required vs. optional scopes, refer to [manage access scopes](/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes). ## Scopes Provides utilities to query, request, and revoke access scopes for the app using the Admin API. ### Scopes The Scopes API enables embedded apps and extensions to request merchant consent for access scopes. ### query Queries Shopify for the scopes for this app on this shop ### request Requests the merchant to grant the provided scopes for this app on this shop This will open a [permission grant modal](/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes#request-access-scopes-using-the-app-bridge-api-for-embedded-apps) for the merchant to accept or decline the scopes. ### revoke Revokes the provided scopes from this app on this shop ### ScopesDetail ### granted The scopes that have been granted on the shop for this app ### optional The optional scopes that the app has declared in its configuration ### required The required scopes that the app has declared in its configuration ### ScopesRequestResponse ### detail ### result ### UserResult `UserResult` represents the results of a user responding to a scopes request, i.e. a merchant user’s action taken when presented with a grant modal. 'granted-all' | 'declined-all' ### ScopesRevokeResponse ### detail ## Related - [Managing Access Scopes](/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes) - [Remix Scopes API](/docs/api/shopify-app-remix/v3/apis/scopes) ## Examples The Scopes API provides the ability to dynamically manage your access scopes within an embedded context. > Tip: > To learn more about declaring and requesting access scopes, as well as required vs. optional scopes, refer to [manage access scopes](/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes). ### Query ### Query access scopes granted to the app on this store ```js const { granted } = await shopify.scopes.query(); ``` ### Request ### Request the user to grant access to the `read_products` scope ```js const response = await shopify.scopes.request(['read_products', 'write_discounts']); if (response.result === 'granted-all') { // merchant has been granted access — continue ... } else if (response.result === 'declined-all') { // merchant has declined access — handle accordingly ... } ``` ### Revoke ### Revoke the granted access to the `read_products` scope ```js await shopify.scopes.revoke(['read_products']); ```