PATCH

Update Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a rule.

Each time the rule is updated, revision increments by 1. The existing revision must be included when updating the rule. This ensures you're working with the latest rule and prevents unintended overwrites.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Moderation Rules
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/moderation/v1/rules/{rule.id}

Path Params
rule.idstringRequired

Rule ID.

Body Params
ruleRuleRequired

Rule to update.

Response Object
ruleRule

Updated rule.

Update a rule's audience type
Request
cURL
curl -X POST https://www.wixapis.com/moderation/v1/rules \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ -d '{ "rule": { "id": "500ea62c-5f4c-4a51-b813-0bd7f239c6dd", "revision": "1" "namespace": "reviews/stores", "audience": { "type": "VISITORS" } }, "fieldMask": { "paths": ["audience.type"] } }'
Response
JSON
{ "rule": { "id": "500ea62c-5f4c-4a51-b813-0bd7f239c6dd", "revision": "2", "created_date": "2023-10-10T06:52:04.718Z", "updated_date": "2023-10-10T06:58:01.595Z", "namespace": "reviews/stores", "name": "Check for Rating", "audience": { "type": "VISITOR" }, "trigger": { "attribute": { "name": "rating", "values": ["1", "2"] } }, "exemptions": { "member_groups": [], "member_ids": [] }, "action": { "type": "NEEDS_MANUAL_APPROVAL" }, "enabled": true } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?