> 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

# Method name: queryCreateRequests()

# Method package: wixGroupsBackend

# Method menu location: wixGroupsBackend --> CreateRequests --> queryCreateRequests

# Method Link: https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/query-create-requests.md

# Method Description:

Creates a query to retrieve a list of create requests.

 

> **Notes:** 
> + This function is only relevant if admin approval is required for creating a group, or if the function's `suppressAuth` option is set to `true`.
> + For `SECRET` groups, only site admins can query requests to create a group. However, if the `suppressAuth` option is set to `true`, all permissions are overwritten, and all site members can query requests to create secret groups.

The `queryCreateRequests()` function builds a query to retrieve a list of all requests to create a group, and returns a [CreateRequestsQueryBuilder](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/introduction.md) object.

The returned object contains the query definition which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/find.md) function. 

You can refine the query by chaining `CreateRequestsQueryBuilder` functions onto the query. `CreateRequestsQueryBuilder` functions enable you to sort, filter, and control the results that `queryCreateRequests()` returns.

`queryCreateRequests()` runs with these `CreateRequestsQueryBuilder` defaults, which you can override:
 + [`limit(1000)`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/limit.md)
 + [`descending("_createdDate")`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/descending.md)

The following `CreateRequestsQueryBuilder` functions are supported for `queryCreateRequests()`. For a full description of the CreateRequests object, see the object returned for the [`items`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-result/items.md) property in [`CreateRequestsQueryResult`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-result/introduction.md).

| Property                    | Supported Filters & Sorting                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`                    | [`eq()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/eq.md), [`ne()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/ne.md), [`hasSome()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/has-some.md), [`or()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/or.md)                               |
| `_createdDate`              | [`ascending()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/ascending.md), [`descending()`](https://dev.wix.com/docs/velo/apis/wix-groups-backend/create-requests/create-requests-query-builder/descending.md)     |



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Query requests to create a group

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { createRequests } from 'wix-groups-backend';

export const myQueryCreateRequestsFunction = webMethod(Permissions.Anyone, () => {
  return createRequests.queryCreateRequests()
    .find()
    .then((results) => {
      const items = results.items;
      const firstItem = items[0];
      const pageSize = results.pageSize;
      const totalPages = results.totalPages;
      const totalCount = results.totalCount;
      const currentPage = results.currentPage();
      const next = results.next();
      const previous = results.prev();
      const hasNext = results.hasNext();
      const hasPrev = results.hasPrev();
      const length = results.length;

      return items;
    })
    .catch((error) => {
      console.error(error);
    });
});

/* Returns items:
 *  { 
 *    "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7"
 *    "status": "PENDING",
 *    "group": {
 *      "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7"
 *      "name": "My Group Request 1"
 *      "slug": "my-group-request-1"
 *      "description": "Welcome to the group! You can connect with other members, get updates and share videos."
 *      "privacyStatus": "PUBLIC"
 *      "coverImage": {
 *        "imageUrl": "wix:image://v1/ff9074e348009011fa9f2dzcvx22~mv2.jpg/fossil.jpg#originWidth=800&originHeight=720",
 *        "position": {
 *          "x": 9,
 *          "y": 4
 *        }
 *      }
 *      "memberTitle": "Employees"
 *      "memberCount": 1
 *      "settings": {
 *        "groupUpdatePostEnabled": true
 *        "membersCanApprove": false
 *        "membersCanInvite": true
 *        "showMemberList": true
 *        "welcomeMemberPostEnabled": true
 *      }
 *      "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300"
 *      "_createdDate": "Tues January 22 2021 12:56:02 GMT+0300"
 *      "_updatedDate": "Fri October 2 2021 04:56:22 GMT+0300"
 *      "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34"
 *    }
 *  },
 *  {
 *    "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221"
 *    "status": "APPROVED",
 *    "group": {
 *      "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221"
 *      "name": "My Group Request 2"
 *      "slug": "my-group-request-2"
 *      "description": "Welcome to the group! You can connect with other members, get updates and share videos."
 *      "privacyStatus": "PRIVATE"
 *      "coverImage": {
 *        "imageUrl": "wix:image://v1/ef9074e348009011fa9f2dzcvx22~mv2.jpg/house.jpg#originWidth=559&originHeight=399",
 *        "position": {
 *          "x": 30,
 *          "y": 225
 *        }
 *      }
 *      "memberTitle": "Friends"
 *      "memberCount": 65
 *      "settings": {
 *        "groupUpdatePostEnabled": true
 *        "membersCanApprove": true
 *        "membersCanInvite": true
 *        "showMemberList": false
 *        "welcomeMemberPostEnabled": true
 *      }
 *      "lastActivityDate": "Thurs Nov 12 2020 11:13:03 GMT+0300"
 *      "_createdDate": "Wed May 14 2020 10:05:20 GMT+0300"
 *      "_updatedDate": "Sun June 7 2020 09:07:33 GMT+0300"
 *      "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67"
 *    }
 *  }
 *    "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337"
 *    "status": "REJECTED"
 *    "rejectionReason": "This group has inappropriate content.",
 *    "group": {
 *      "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337"
 *      "name": "My Group Request 3"
 *      "slug": "my-group-request-3"
 *      "description": "Welcome to the group! You can connect with other members, get updates and share videos."
 *      "privacyStatus": "PRIVATE"
 *      "coverImage": {
 *        "imageUrl": "wix:image://v1/ff9074e348009011fa9f2dzcvx22~mv2.jpg/friends.jpg#originWidth=4494&originHeight=2248",
 *        "position": {
 *          "x": 36,
 *          "y": 87
 *        }
 *      }
 *      "memberTitle": "Students"
 *      "memberCount": 1
 *      "settings": {
 *        "groupUpdatePostEnabled": true
 *        "membersCanApprove": true
 *        "membersCanInvite": true
 *        "showMemberList": false
 *        "welcomeMemberPostEnabled": true
 *      }
 *      "lastActivityDate": "Mon Feb 04 2019 01:19:53 GMT+0300"
 *      "_createdDate": "Mon Feb 04 2019 01:19:53 GMT+0300"
 *      "_updatedDate": "Mon Feb 04 2019 01:19:53 GMT+0300"
 *      "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67"
 *    }
 *  }
 * ]
 */
```

---