> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # DisconnectFromSharedCollection # Package: collectionManagement # Namespace: DataCollectionSharingService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/disconnect-from-shared-collection.md ## Permission Scopes: Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING ## Introduction Disconnects the current site from a shared data collection. This method removes the local view of the shared collection from the current site. Once removed, the collection is no longer accessible through the CMS or Data Items APIs. > **Note:** This method doesn't affect the collection on the source site or other target sites that share the collection. --- ## REST API ### Schema ``` Method: disconnectFromSharedCollection Description: Disconnects the current site from a shared data collection. This method removes the local view of the shared collection from the current site. Once removed, the collection is no longer accessible through the CMS or Data Items APIs. > **Note:** This method doesn't affect the collection on the source site or other target sites that share the collection. URL: https://www.wixapis.com/data/v1/data-collection-sharing/disconnect-from-shared-collection Method: POST Method parameters: param name: dataCollectionId | type: dataCollectionId | description: Shared data collection GUID. param name: targetDataCollectionId | type: targetDataCollectionId | description: GUID of the shared collection on the target site. Return type: DisconnectFromSharedCollectionResponse EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0156 | Description: Shared collection not found. Verify the collection GUID is correct and that the collection is shared with the current site. ``` ### Examples ### Disconnect from shared collection ```curl curl -X DELETE \ 'https://wixapis.com/wix-data/v1/data-collection-sharing/shared/shared%2FmyCollection' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.collectionManagement.DataCollectionSharingService.disconnectFromSharedCollection(options) Description: Disconnects the current site from a shared data collection. This method removes the local view of the shared collection from the current site. Once removed, the collection is no longer accessible through the CMS or Data Items APIs. > **Note:** This method doesn't affect the collection on the source site or other target sites that share the collection. Method parameters: param name: options | type: DisconnectFromSharedCollectionOptions none - name: targetDataCollectionId | type: string | description: GUID of the shared collection on the target site. Return type: PROMISE EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0156 | Description: Shared collection not found. Verify the collection GUID is correct and that the collection is shared with the current site. ``` ### Examples ### disconnectFromSharedCollection ```javascript import { sharing } from '@wix/data'; async function disconnectFromSharedCollection(options) { const response = await sharing.disconnectFromSharedCollection(options); }; ``` ### disconnectFromSharedCollection (with elevated permissions) ```javascript import { sharing } from '@wix/data'; import { auth } from '@wix/essentials'; async function myDisconnectFromSharedCollectionMethod(options) { const elevatedDisconnectFromSharedCollection = auth.elevate(sharing.disconnectFromSharedCollection); const response = await elevatedDisconnectFromSharedCollection(options); } ``` ### disconnectFromSharedCollection (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { sharing } from '@wix/data'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { sharing }, // Include the auth strategy and host as relevant }); async function disconnectFromSharedCollection(options) { const response = await myWixClient.sharing.disconnectFromSharedCollection(options); }; ``` ---