> 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 # DeleteDataSharingPolicy # Package: collectionManagement # Namespace: DataCollectionSharingService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/delete-data-sharing-policy.md ## Permission Scopes: Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING ## Introduction Deletes a data sharing policy and disconnects all associated connections.
__Warning:__ When you delete a sharing policy, all target sites connected to the shared collection using this policy immediately lose access to the collection and its data. This can cause code in the target sites to break.
--- ## REST API ### Schema ``` Method: deleteDataSharingPolicy Description: Deletes a data sharing policy and disconnects all associated connections.
__Warning:__ When you delete a sharing policy, all target sites connected to the shared collection using this policy immediately lose access to the collection and its data. This can cause code in the target sites to break.
URL: https://www.wixapis.com/data/v1/data-collection-sharing/policies/{dataSharingPolicyId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataSharingPolicyId Method parameters: param name: dataSharingPolicyId | type: none | required: true Return type: DeleteDataSharingPolicyResponse EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0154 | Description: Data sharing policy not found. Verify the policy GUID is correct and is owned by the current site. ``` ### Examples ### Delete data sharing policy ```curl curl -X DELETE \ 'https://wixapis.com/wix-data/v1/data-collection-sharing/policies/f6d058c0-6d5a-4ca5-b4a6-24933fce9175' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.collectionManagement.DataCollectionSharingService.deleteDataSharingPolicy(dataSharingPolicyId) Description: Deletes a data sharing policy and disconnects all associated connections.
__Warning:__ When you delete a sharing policy, all target sites connected to the shared collection using this policy immediately lose access to the collection and its data. This can cause code in the target sites to break.
# Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataSharingPolicyId Method parameters: param name: dataSharingPolicyId | type: string | description: Data sharing policy GUID. | required: true Return type: PROMISE EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0154 | Description: Data sharing policy not found. Verify the policy GUID is correct and is owned by the current site. ``` ### Examples ### deleteDataSharingPolicy ```javascript import { sharing } from '@wix/data'; async function deleteDataSharingPolicy(dataSharingPolicyId) { const response = await sharing.deleteDataSharingPolicy(dataSharingPolicyId); }; ``` ### deleteDataSharingPolicy (with elevated permissions) ```javascript import { sharing } from '@wix/data'; import { auth } from '@wix/essentials'; async function myDeleteDataSharingPolicyMethod(dataSharingPolicyId) { const elevatedDeleteDataSharingPolicy = auth.elevate(sharing.deleteDataSharingPolicy); const response = await elevatedDeleteDataSharingPolicy(dataSharingPolicyId); } ``` ### deleteDataSharingPolicy (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 deleteDataSharingPolicy(dataSharingPolicyId) { const response = await myWixClient.sharing.deleteDataSharingPolicy(dataSharingPolicyId); }; ``` ---