> 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 # DeleteRule # Package: feedbackModeration # Namespace: ModerationRules # Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/moderation-rules/delete-rule.md ## Permission Scopes: Manage Moderation Rules: SCOPE.MODERATION.MANAGE-MODERATION-RULES ## Introduction Permanently deletes a rule. --- ## REST API ### Schema ``` Method: deleteRule Description: Permanently deletes a rule. URL: https://www.wixapis.com/moderation/v1/rules/{ruleId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: ruleId Method parameters: param name: ruleId | type: none | required: true Return type: DeleteRuleResponse EMPTY-OBJECT {} ``` ### Examples ### Delete a rule ```curl curl -X DELETE https://www.wixapis.com/moderation/v1/rules/500ea62c-5f4c-4a51-b813-0bd7f239c6dd \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.feedbackModeration.ModerationRules.deleteRule(ruleId) Description: Permanently deletes a rule. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: ruleId Method parameters: param name: ruleId | type: string | description: GUID of the rule to delete. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### deleteRule ```javascript import { moderationRules } from '@wix/moderation-rules'; async function deleteRule(ruleId) { const response = await moderationRules.deleteRule(ruleId); }; ``` ### deleteRule (with elevated permissions) ```javascript import { moderationRules } from '@wix/moderation-rules'; import { auth } from '@wix/essentials'; async function myDeleteRuleMethod(ruleId) { const elevatedDeleteRule = auth.elevate(moderationRules.deleteRule); const response = await elevatedDeleteRule(ruleId); } ``` ### deleteRule (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 { moderationRules } from '@wix/moderation-rules'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { moderationRules }, // Include the auth strategy and host as relevant }); async function deleteRule(ruleId) { const response = await myWixClient.moderationRules.deleteRule(ruleId); }; ``` ---