> 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

# Package: cmsCompliance

# Namespace: complianceReviewRequestV1

# Webhook link: https://dev.wix.com/docs/api-reference/account-level/enterprise/cms-compliance/compliance-review-request-v1/compliance-review-request-review-requested.md

## Introduction

# Webhook Permissions Scopes IDs:
Enterprise CMS compliance flow : SCOPE.ENTERPRISE.CMS-COMPLIANCE-MANAGE

---

## REST API

### Schema

```
Webhook: Compliance Review Request Review Requested
Description: 
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: actionEvent | type: object | description: Custom action event details.
    - name: body | type: ReviewRequested | description: The event body.
        - name: complianceReviewRequest | type: ComplianceReviewRequest | description: Submitted compliance review request.
           - name: id | type: string | description: Compliance review request GUID. Matches the `_id` of the submitted data item.
           - name: action | type: ReviewAction | description: Compliance action the user performed on the data item.
               - enum:
               -     CREATE: A data item was created.
               -     UPDATE: A data item was updated.
               -     UNPUBLISH: A data item was unpublished.
               -     DELETE: A data item was deleted. `DELETE` isn't currently supported and returns the `UNSUPPORTED_ACTION` error. Support is planned for the future.
           - name: currentDataItem | type: DataItem | description: Published (live) version of the data item: what is stored right now and is subject to change. Returned for `UPDATE` and `UNPUBLISH` actions. Absent for `CREATE`, when nothing is live yet.
              - name: id | type: string | description: Data item GUID.  When an item is inserted into a collection, the item's GUID is automatically assigned a random value. You can optionally provide a custom GUID in `dataItem.id` when inserting the item. If you specify an GUID that already exists in the collection, the insertion will fail.
              - name: dataCollectionId | type: string | description: GUID of the collection this item belongs to.  This is the user-defined collection identifier set when the collection is created (for example, `EvalCustomers`), not a GUID.
              - name: data | type: object | description: Data item contents.  Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:  + `_id`: Item GUID. + `_createdDate`: Date and time the item was added to the collection. + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value. + `_ownerId`: GUID of the user who created the item. Can be modified with site owner permissions.
           - name: proposedDataItem | type: DataItem | description: Draft version of the data item: the change that takes effect once approved. Returned for `CREATE` and `UPDATE` actions. Absent for `UNPUBLISH`, when nothing is being drafted.
           - name: submittedAt | type: string | description: Date and time the action was submitted.
           - name: submittedByUserId | type: string | description: GUID of the user who submitted the action.
           - name: submittedByAccountId | type: string | description: GUID of the account the action was submitted under.

```

---

## JavaScript SDK

### Schema

```
Webhook: onComplianceReviewRequestReviewRequested
Description: 
Payload: ComplianceReviewRequestReviewRequestedEnvelope
  - name: data | type: ReviewRequested | description: none
     - name: complianceReviewRequest | type: ComplianceReviewRequest | description: Submitted compliance review request.
        - name: _id | type: string | description: Compliance review request GUID. Matches the `_id` of the submitted data item.
        - name: action | type: ReviewAction | description: Compliance action the user performed on the data item.
             - enum:
             -     CREATE: A data item was created.
             -     UPDATE: A data item was updated.
             -     UNPUBLISH: A data item was unpublished.
             -     DELETE: A data item was deleted. `DELETE` isn't currently supported and returns the `UNSUPPORTED_ACTION` error. Support is planned for the future.
        - name: currentDataItem | type: DataItem | description: Published (live) version of the data item: what is stored right now and is subject to change. Returned for `UPDATE` and `UNPUBLISH` actions. Absent for `CREATE`, when nothing is live yet.
           - name: _id | type: string | description: Data item GUID.  When an item is inserted into a collection, the item's GUID is automatically assigned a random value. You can optionally provide a custom GUID in `dataItem.id` when inserting the item. If you specify an GUID that already exists in the collection, the insertion will fail.
           - name: dataCollectionId | type: string | description: GUID of the collection this item belongs to.  This is the user-defined collection identifier set when the collection is created (for example, `EvalCustomers`), not a GUID.
           - name: data | type: object | description: Data item contents.  Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:  + `_id`: Item GUID. + `_createdDate`: Date and time the item was added to the collection. + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value. + `_ownerId`: GUID of the user who created the item. Can be modified with site owner permissions.
        - name: proposedDataItem | type: DataItem | description: Draft version of the data item: the change that takes effect once approved. Returned for `CREATE` and `UPDATE` actions. Absent for `UNPUBLISH`, when nothing is being drafted.
        - name: submittedAt | type: Date | description: Date and time the action was submitted.
        - name: submittedByUserId | type: string | description: GUID of the user who submitted the action.
        - name: submittedByAccountId | type: string | description: GUID of the account the action was submitted under.
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { enterpriseCmsCompliance } from '@wix/enterprise-cms-compliance';

enterpriseCmsCompliance.onComplianceReviewRequestReviewRequested((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { enterpriseCmsCompliance } from '@wix/enterprise-cms-compliance';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      enterpriseCmsCompliance,
    },
});

wixClient.enterpriseCmsCompliance.onComplianceReviewRequestReviewRequested((event) => {
    // handle your event here
});
```

---