POST

Create 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.

Creates a rule. You can create up to 20 rules per namespace.

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
POST
https://www.wixapis.com/moderation/v1/rules

Body Params
ruleRuleRequired

Rule info.

Response Object
ruleRule

Created rule.

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": { "namespace": "reviews/f0f2e34e-a407-41bd-b8b0-d11a90b226de", "name": "Check for Store Review Rating", "audience": { "type": "MEMBERS_AND_VISITORS" }, "trigger": { "attribute": { "values": ["1", "2"], "name": "rating" } }, "action": { "type": "NEEDS_MANUAL_APPROVAL" }, "enabled": true } }'
Response
JSON
{ "rule": { "id": "500ea62c-5f4c-4a51-b813-0bd7f239c6dd", "revision": "1", "createdDate": "2023-10-10T06:52:04.718Z", "updatedDate": "2023-10-10T06:52:04.718Z", "namespace": "reviews/f0f2e34e-a407-41bd-b8b0-d11a90b226de", "name": "Check for Rating", "audience": { "type": "MEMBERS_AND_VISITORS" }, "trigger": { "attribute": { "name": "rating", "values": ["1", "2"] } }, "exemptions": { "memberGroups": [], "memberIds": [] }, "action": { "type": "NEEDS_MANUAL_APPROVAL" }, "enabled": true } }
Errors
428Failed Precondition

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

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