> 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

# QueryMemberReports

# Package: activity

# Namespace: MemberReports

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

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

## Introduction

Retrieves a list of up to 1,000 member reports, given the provided paging, filtering, and sorting.

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

- `createdDate` is sorted in `DESC` order
- `paging.limit` is `100`

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: queryMemberReports
 Description: Retrieves a list of up to 1,000 member reports, given the provided paging, filtering, and sorting.  Query Member Reports runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `paging.limit` is `100`  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-reports/query
 Method: POST
 Method parameters:
   param name: query | type: QueryV2    
        - 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`  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) for more information.  
        - name: sorting | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  
           - 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
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
        - name: paging | type: CursorPaging | description: Cursor paging options.  
           - name: limit | type: integer | description: Number of items to load.  Default: `100`  | validation: minimum 0, maximum 1000, format int32
           - name: cursor | type: string | description: Cursor pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportedMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportingMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reason | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
 Return type: QueryMemberReportsResponse
  - name: memberReports | type: array<MemberReport> | description: Retrieved member reports.  
     - name: id | type: string | description: Report GUID.  | read-only: true | validation: format GUID
     - name: reportedMemberId | type: string | description: GUID of the reported member.  | validation: format GUID
     - name: reportingMemberId | type: string | description: GUID of the member who created the report. Set automatically to the GUID of the member who called [Report Member](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/member-reports/report-member.md).  | read-only: true 
     - name: reason | type: Reason | description: Reason for reporting the member.  
        - name: category | type: Category | description: Report reason category.  
             - enum:
             -     UNKNOWN: Unknown category.
             -     SPAM: The member is reported for sending spam.
             -     IMPERSONATION: The member is reported for impersonating someone else.
             -     HARASSMENT: The member is reported for harassing other members.
             -     OTHER: The member is reported for a reason not covered by the other categories.
        - name: description | type: string | description: Explanation of why the member is reported.  Required when `category` is `IMPERSONATION`, `HARASSMENT`, or `OTHER`.  
     - name: createdDate | type: string | description: Date and time the report was created.  | read-only: true | validation: format date-time
  - name: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - 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


```

### Examples

### Query member reports
Retrieves all member reports, sorted by creation date in descending order.

```curl
curl -X POST \
'https://www.wixapis.com/members/v1/member-reports/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{}'
```

### Query reports created by a member with paging
Retrieves the reports created by a specific member, 1 per page.

```curl
curl -X POST \
'https://www.wixapis.com/members/v1/member-reports/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "reportingMemberId": "df77483e-6930-4b0f-996a-1dd3f95b85fe"
    },
    "paging": {
      "limit": 1
    }
  }
}'
```

### Query member reports about a member
Retrieves the reports about a specific member.

```curl
curl -X POST \
'https://www.wixapis.com/members/v1/member-reports/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "reportedMemberId": "e411fe13-9794-42b6-ad62-72c9917f1bac"
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.members.memberReport.queryMemberReports(query)
 Description: Retrieves a list of up to 1,000 member reports, given the provided paging, filtering, and sorting.  Query Member Reports runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `paging.limit` is `100`  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: MemberReportQuery   | required: true 
        - 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`  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) for more information.  
        - name: sorting | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  
           - 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
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
        - name: paging | type: CursorPaging | description: Cursor paging options.  
           - name: limit | type: integer | description: Number of items to load.  Default: `100`  | validation: minimum 0, maximum 1000, format int32
           - name: cursor | type: string | description: Cursor pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportedMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reportingMemberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: none | aggregatable: undefined | searchable: undefined
   - field: reason | operators: $exists | sort: none | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: none | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryMemberReportsResponse>
  - name: memberReports | type: array<MemberReport> | description: Retrieved member reports.  
     - name: _id | type: string | description: Report GUID.  | read-only: true | validation: format GUID
     - name: reportedMemberId | type: string | description: GUID of the reported member.  | validation: format GUID
     - name: reportingMemberId | type: string | description: GUID of the member who created the report. Set automatically to the GUID of the member who called [Report Member](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/member-reports/report-member.md).  | read-only: true 
     - name: reason | type: Reason | description: Reason for reporting the member.  
        - name: category | type: Category | description: Report reason category.  
             - enum:
             -     UNKNOWN: Unknown category.
             -     SPAM: The member is reported for sending spam.
             -     IMPERSONATION: The member is reported for impersonating someone else.
             -     HARASSMENT: The member is reported for harassing other members.
             -     OTHER: The member is reported for a reason not covered by the other categories.
        - name: description | type: string | description: Explanation of why the member is reported.  Required when `category` is `IMPERSONATION`, `HARASSMENT`, or `OTHER`.  
     - name: _createdDate | type: Date | description: Date and time the report was created.  | read-only: true 
  - name: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - 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


```

### Examples

### Query member reports about a member
Retrieves the reports about a specific member, 10 per page.

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

async function queryMemberReports() {
  const response = await memberReport.queryMemberReports({
    filter: { reportedMemberId: "e411fe13-9794-42b6-ad62-72c9917f1bac" },
    sorting: [{ fieldName: "createdDate", order: "DESC" }],
    paging: { limit: 10 },
  });
}

/* Promise resolves to:
 * {
 *   "memberReports": [
 *     {
 *       "_id": "dd7cfd02-1837-4fb8-bc6f-86316f0984a9",
 *       "reportedMemberId": "e411fe13-9794-42b6-ad62-72c9917f1bac",
 *       "reportingMemberId": "df77483e-6930-4b0f-996a-1dd3f95b85fe",
 *       "reason": {
 *         "category": "HARASSMENT",
 *         "description": "This member keeps sending me offensive messages."
 *       },
 *       "_createdDate": "2024-01-15T10:30:00.000Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "total": 1,
 *     "cursors": {}
 *   }
 * }
 */

```

### queryMemberReports (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 { memberReport } from '@wix/members';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function queryMemberReports(query) {
  const response = await myWixClient.memberReport.queryMemberReports(query);
};
```

---