> 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

# QueryMemberReportOverviews

# Package: activity

# Namespace: MemberReportOverviews

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/member-report-overview-v1/query-member-report-overviews.md

## Permission Scopes:
Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS

## Introduction

Retrieves a list of up to 100 member report overviews, given the provided paging, filtering, and sorting.

Query Member Report Overviews runs with these defaults, which you can override:

- `paging.limit` is `100`

Results aren't sorted unless you specify `sort`. For example, sort by `lastReportDate` in `DESC` order to retrieve the most recently reported members first.

To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).

---

## REST API

### Schema

```
 Method: queryMemberReportOverviews
 Description: Retrieves a list of up to 100 member report overviews, given the provided paging, filtering, and sorting.  Query Member Report Overviews runs with these defaults, which you can override:  - `paging.limit` is `100`  Results aren't sorted unless you specify `sort`. For example, sort by `lastReportDate` in `DESC` order to retrieve the most recently reported members first.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 URL: https://www.wixapis.com/members/v1/member-report-overviews/query
 Method: POST
 Method parameters:
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  Default: `100`  | 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.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | 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: reportedMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportCount | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: reviewed | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: lastReportDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
 Return type: QueryMemberReportOverviewsResponse
  - name: memberReportOverviews | type: array<MemberReportOverview> | description: Retrieved member report overviews.  
     - name: id | type: string | description: Member report overview GUID. Identical to `reportedMemberId`.  | read-only: true | validation: format GUID
     - name: reportedMemberId | type: string | description: GUID of the reported member.  | validation: format GUID
     - name: reportCount | type: string | description: Number of reports about the member.  
     - name: reviewed | type: boolean | description: Whether the reports about the member have been reviewed.  Reset to `false` each time the member is reported again.  
     - name: lastReportDate | type: string | description: Date and time the most recent report about the member was created.  | read-only: true | validation: format date-time
  - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in current page.  | 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 the most reported members
Retrieves the 2 members with the most reports.

```curl
curl -X POST \
'https://www.wixapis.com/members/v1/member-report-overviews/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "sort": [
      {
        "fieldName": "reportCount",
        "order": "DESC"
      }
    ],
    "cursorPaging": {
      "limit": 2
    }
  }
}'
```

### Query members with unreviewed reports
Retrieves members whose reports haven't been reviewed, starting with the most recently reported.

```curl
curl -X POST \
'https://www.wixapis.com/members/v1/member-report-overviews/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "reviewed": false
    },
    "sort": [
      {
        "fieldName": "lastReportDate",
        "order": "DESC"
      }
    ]
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.members.memberReportOverviews.queryMemberReportOverviews(query)
 Description: Retrieves a list of up to 100 member report overviews, given the provided paging, filtering, and sorting.  Query Member Report Overviews runs with these defaults, which you can override:  - `paging.limit` is `100`  Results aren't sorted unless you specify `sort`. For example, sort by `lastReportDate` in `DESC` order to retrieve the most recently reported members first.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-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: MemberReportOverviewQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  Default: `100`  | 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.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | 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: reportedMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportCount | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
   - field: reviewed | operators: $eq, $ne, $in, $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: lastReportDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryMemberReportOverviewsResponse>
  - name: memberReportOverviews | type: array<MemberReportOverview> | description: Retrieved member report overviews.  
     - name: _id | type: string | description: Member report overview GUID. Identical to `reportedMemberId`.  | read-only: true | validation: format GUID
     - name: reportedMemberId | type: string | description: GUID of the reported member.  | validation: format GUID
     - name: reportCount | type: string | description: Number of reports about the member.  
     - name: reviewed | type: boolean | description: Whether the reports about the member have been reviewed.  Reset to `false` each time the member is reported again.  
     - name: lastReportDate | type: Date | description: Date and time the most recent report about the member was created.  | read-only: true 
  - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in current page.  | 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 members with unreviewed reports
Retrieves members whose reports haven't been reviewed, starting with the most recently reported.

```javascript
import { memberReportOverviews } from "@wix/members";

async function queryMemberReportOverviews() {
  const response = await memberReportOverviews.queryMemberReportOverviews({
    filter: { reviewed: false },
    sort: [{ fieldName: "lastReportDate", order: "DESC" }],
    cursorPaging: { limit: 10 },
  });
}

/* Promise resolves to:
 * {
 *   "memberReportOverviews": [
 *     {
 *       "_id": "e411fe13-9794-42b6-ad62-72c9917f1bac",
 *       "reportedMemberId": "e411fe13-9794-42b6-ad62-72c9917f1bac",
 *       "reportCount": "5",
 *       "reviewed": false,
 *       "lastReportDate": "2024-01-15T10:30:00.000Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "cursors": {},
 *     "hasNext": false
 *   }
 * }
 */

```

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

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


async function queryMemberReportOverviews(query) {
  const response = await myWixClient.memberReportOverviews.queryMemberReportOverviews(query);
};
```

---