> 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 # DeletePolicy # Package: eventManagement # Namespace: PolicyManagement # Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/policies-v2/delete-policy.md ## Permission Scopes: Manage Policies: SCOPE.DC-EVENTS.MANAGE-POLICIES ## Introduction Permanently deletes a policy. Deleted policies are not returned by the Get Policy or Query Policy methods. --- ## REST API ### Schema ``` Method: deletePolicy Description: Permanently deletes a policy. Deleted policies are not returned by the Get Policy or Query Policy methods. URL: https://www.wixapis.com/events/v2/policies/{policyId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: policyId Method parameters: param name: policyId | type: none | required: true Return type: DeletePolicyResponse EMPTY-OBJECT {} ``` ### Examples ### Delete Policy ```curl curl -X DELETE 'https://www.wixapis.com/events/v2/policies/7243931d-74e4-4d6a-91f0-4835fa79161e' \ -H 'Authorization: ' \ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.eventManagement.PolicyManagement.deletePolicy(policyId) Description: Permanently deletes a policy. Deleted policies are not returned by the Get Policy or Query Policy methods. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: policyId Method parameters: param name: policyId | type: string | description: GUID of the policy to delete. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### Delete Policy (with elevated permissions) ```javascript import { policies } from '@wix/events'; import { auth } from '@wix/essentials'; const elevatedDeletePolicy = auth.elevate(policies.deletePolicy); //define policy ID const policyId = '0907cf78-5177-4482-a627-b17ef06badec'; //delete policy function myDeletePolicyFunction(){ try { return elevatedDeletePolicy(policyId); } catch (error) { console.error(error); // Handle the error } }; // Returns void ``` ### Delete Policy ```javascript import { policies } from '@wix/events'; //define policy ID const policyId = '0907cf78-5177-4482-a627-b17ef06badec'; //delete policy function myDeletePolicyFunction(){ try { return policies.deletePolicy(policyId); } catch (error) { console.error(error); // Handle the error } }; // Returns void ``` ### deletePolicy (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 { policies } from '@wix/events'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { policies }, // Include the auth strategy and host as relevant }); async function deletePolicy(policyId) { const response = await myWixClient.policies.deletePolicy(policyId); }; ``` ---