Setup

To use the Rules API, install the @wix/groups package using npm or Yarn:

Copy
1
npm install @wix/groups

or

Copy
1
yarn add @wix/groups

Then import { rules } from @wix/groups:

Copy
1
import { rules } from '@wix/groups'
Was this helpful?
Yes
No

createOrReplaceAllRules( )

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 rules if no rules have been set up. Otherwise, replaces all existing rules.

Note: Only admins can create or replace rules.

Note: This endpoint requires visitor or member authentication.

Copy
function createOrReplaceAllRules(groupId: string, options: CreateOrReplaceAllRulesOptions): Promise<CreateOrReplaceAllRulesResponse>
Method Parameters
groupIdstringRequired
Group ID.

optionsCreateOrReplaceAllRulesOptions
Returns
Return Type:Promise<CreateOrReplaceAllRulesResponse>
Was this helpful?
Yes
No

listRules( )

Developer Preview

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

Retrieves rules.

Note: This endpoint requires visitor or member authentication.

Copy
function listRules(groupId: string): Promise<ListRulesResponse>
Method Parameters
groupIdstringRequired
Group ID.
Returns
Return Type:Promise<ListRulesResponse>
Was this helpful?
Yes
No