> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryReviewRequests

# Package: reviews

# Namespace: ReviewRequestsV2

# Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reviews/review-requests/query-review-requests?apiView=SDK.md

## Permission Scopes:
Read Review Requests: SCOPE.DC_REVIEWS.READ-REVIEW_REQUESTS

## Introduction

Retrieves a list of review requests, give the provided paging, filtering, and sorting.

Query Review Requests runs with these defaults, which you can override:
+ `createdDate` in `ASC` order

To learn about working with _Query_ endpoints, see
[API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md),
[Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md),
and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/field-projection.md).

---

## REST API

### Schema

```
 Method: queryReviewRequests
 Description: Retrieves a list of review requests, give the provided paging, filtering, and sorting.  Query Review Requests runs with these defaults, which you can override: + `createdDate` in `ASC` order  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/field-projection.md).
 URL: https://www.wixapis.com/reviews/v2/review-requests/query
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: CursorQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: namespace | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: communicationChannel | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: recipient.contactId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.identityType | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.wixUserId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.appId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: items.catalogItemId | operators: $eq, $ne, $in, $nin, $hasSome, $hasAll | sort: none | aggregatable: undefined | searchable: undefined
   - field: items.reviewId | operators: $eq, $ne, $in, $nin, $exists, $hasSome, $hasAll | sort: none | aggregatable: undefined | searchable: undefined
   - field: order.id | operators: $eq, $ne, $in, $nin, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: automationActivationId | operators: $eq, $ne, $in, $nin, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: sendDate | operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: status | operators: $eq, $ne, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryReviewRequestsResponse
  - name: reviewRequests | type: array<ReviewRequest> | description: Retrieved review requests.  
     - ONE-OF: 
        - name: sentOptions | type: SentOptions | description: Info if `status` is `SENT`.  | read-only: true 
           - name: opened | type: boolean | description: Whether the recipient opened the review request email.  
        - name: failedOptions | type: FailedOptions | description: Info if `status` is `FAILED`.  | read-only: true 
           - name: reason | type: FailureReason | description: Reason review request `status` is `FAILED`.  
                 - enum:
                 -     UNKNOWN_FAILURE_REASON: Unknown reason for review request failure.
                 -     ACTIVATION_FAILED: Review request failed due to a failure in the activation flow.
                 -     BOUNCED: Email bounced.
                 -     SUBSCRIPTION_INACTIVE: Review request failed because `deliverabilityStatus` is set to `inactiveSubscription` in the recipient's contact information.
           - name: message | type: string | description: Error message for review request failure.  | validation: maxLength 1000
     - name: id | type: string | description: Review request GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the review request is updated. To prevent conflicting changes, the current revision must be passed when updating the review request.  Ignored when creating a review request.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the review request was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the review request was last updated.  | read-only: true | validation: format date-time
     - name: sendDate | type: string | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: format date-time, immutable
     - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
     - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
        - name: id | type: string | description: Order GUID.  | validation: format GUID
     - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
        - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
        - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient.  | read-only: true | validation: format GUID
     - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
        - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
     - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request.  | validation: immutable
         - enum: EMAIL
     - name: status | type: ReviewRequestStatus | description: Review request status.  | read-only: true 
         - enum:
         -     UNKNOWN_REVIEW_REQUEST_STATUS: Unknown review request status.
         -     SCHEDULED: Review request scheduled.
         -     CANCELED: Review request canceled.
         -     FAILED: Review request failed to send.
         -     SENT: Review request sent.
     - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
     - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request.  | read-only: true 
        - ONE-OF: 
           - name: wixUserId | type: string | description: Wix user GUID.  | validation: format GUID
           - name: appId | type: string | description: Wix app GUID.  | validation: format GUID
        - name: identityType | type: IdentityType | description: Identity type.  | read-only: true 
             - enum: WIX_USER, APP
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query Review Requests
```curl
curl -X POST \
  'https://www.wixapis.com/reviews/v2/review-requests/query'  \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
        "query":
          {
            "filter":
              {
                "namespace": "stores"
              }
          }
        }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.reviews.reviewRequests.queryReviewRequests(query)
 Description: Retrieves a list of review requests, give the provided paging, filtering, and sorting.  Query Review Requests runs with these defaults, which you can override: + `createdDate` in `ASC` order  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/field-projection.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: ReviewRequestQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: namespace | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: communicationChannel | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: recipient.contactId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.identityType | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.wixUserId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: requestedBy.appId | operators: $eq, $ne, $in, $nin | sort: none | aggregatable: undefined | searchable: undefined
   - field: items.catalogItemId | operators: $eq, $ne, $in, $nin, $hasSome, $hasAll | sort: none | aggregatable: undefined | searchable: undefined
   - field: items.reviewId | operators: $eq, $ne, $in, $nin, $exists, $hasSome, $hasAll | sort: none | aggregatable: undefined | searchable: undefined
   - field: order._id | operators: $eq, $ne, $in, $nin, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: automationActivationId | operators: $eq, $ne, $in, $nin, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: sendDate | operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: status | operators: $eq, $ne, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryReviewRequestsResponse>
  - name: reviewRequests | type: array<ReviewRequest> | description: Retrieved review requests.  
     - ONE-OF: 
        - name: sentOptions | type: SentOptions | description: Info if `status` is `SENT`.  | read-only: true 
           - name: opened | type: boolean | description: Whether the recipient opened the review request email.  
        - name: failedOptions | type: FailedOptions | description: Info if `status` is `FAILED`.  | read-only: true 
           - name: reason | type: FailureReason | description: Reason review request `status` is `FAILED`.  
                 - enum:
                 -     UNKNOWN_FAILURE_REASON: Unknown reason for review request failure.
                 -     ACTIVATION_FAILED: Review request failed due to a failure in the activation flow.
                 -     BOUNCED: Email bounced.
                 -     SUBSCRIPTION_INACTIVE: Review request failed because `deliverabilityStatus` is set to `inactiveSubscription` in the recipient's contact information.
           - name: message | type: string | description: Error message for review request failure.  | validation: maxLength 1000
     - name: _id | type: string | description: Review request GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the review request is updated. To prevent conflicting changes, the current revision must be passed when updating the review request.  Ignored when creating a review request.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the review request was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the review request was last updated.  | read-only: true 
     - name: sendDate | type: Date | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: immutable
     - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
     - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
        - name: _id | type: string | description: Order GUID.  | validation: format GUID
     - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
        - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
        - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient.  | read-only: true | validation: format GUID
     - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
        - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
     - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request.  | validation: immutable
         - enum: EMAIL
     - name: status | type: ReviewRequestStatus | description: Review request status.  | read-only: true 
         - enum:
         -     UNKNOWN_REVIEW_REQUEST_STATUS: Unknown review request status.
         -     SCHEDULED: Review request scheduled.
         -     CANCELED: Review request canceled.
         -     FAILED: Review request failed to send.
         -     SENT: Review request sent.
     - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
     - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request.  | read-only: true 
        - ONE-OF: 
           - name: wixUserId | type: string | description: Wix user GUID.  | validation: format GUID
           - name: appId | type: string | description: Wix app GUID.  | validation: format GUID
        - name: identityType | type: IdentityType | description: Identity type.  | read-only: true 
             - enum: WIX_USER, APP
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### queryReviewRequests
```javascript
import { reviewRequests } from '@wix/reviews';

async function queryReviewRequests(query) {
  const response = await reviewRequests.queryReviewRequests(query);
};
```

### queryReviewRequests (with elevated permissions)
```javascript
import { reviewRequests } from '@wix/reviews';
import { auth } from '@wix/essentials';

async function myQueryReviewRequestsMethod(query) {
  const elevatedQueryReviewRequests = auth.elevate(reviewRequests.queryReviewRequests);
  const response = await elevatedQueryReviewRequests(query);
}
```

### queryReviewRequests (self-managed)
Self-managed 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 { reviewRequests } from '@wix/reviews';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { reviewRequests },
  // Include the auth strategy and host as relevant
});


async function queryReviewRequests(query) {
  const response = await myWixClient.reviewRequests.queryReviewRequests(query);
};
```

---