> 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: approveCreateRequests(createRequestIds: Array<string>, options: Options)

# Method package: wixGroupsBackend

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

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

# Method Description:

Approves requests to create a group.

 

> **Note:** 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`.

The `approveCreateRequests()` function returns a Promise that resolves when a site member's request to create a group is approved. 
Only site admins can approve requests to create a group. When the request is approved, the new group is added to the Groups List page of your site.

> **Note:** If the `suppressAuth` option is set to `true`, all permissions are overwritten, and all site members can approve requests to create a group.



# Method Code Examples:

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

## Approve a request to create a group

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

// Sample createRequestIds value:
// ['8a3be85ea03e4b8b82f2f9c989557c3d', '6ff5333-b477-4e9tt-ba4j-df338c5ad6221']
//

export const myApproveCreateRequestsFunction = webMethod(Permissions.Anyone, async (createRequestIds) => {
  try {
    const approvedCreateRequests = await createRequests.approveCreateRequests(createRequestIds);
    return approvedCreateRequests;
  } catch (error) {
    console.error(error);
  }
});

/* Promise resolves to:
 * [
 *  { 
 *    "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7",
 *    "status": "APPROVED"
 *    "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": "PRIVATE"
 *      "coverImage": {
 *        "imageUrl": "wix:image://v1/ff9074e348009011fa9f2d2961b~mv2.jpg/oak.jpg#originWidth=400&originHeight=900",
 *        "position": {
 *          "x": 20,
 *          "y": 25
 *        }
 *      }
 *      "memberTitle": "Friends"
 *      "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/vcc6074e348009011fa9f2d29kk7~mv2.jpg/maple.jpg#originWidth=999&originHeight=240", 
 *        "position": {
 *          "x": 730,
 *          "y": 625
 *        }
 *      "memberTitle": "Members"
 *      "memberCount": 30
 *      "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"
 *    }
 *   }
 * ]
 */
```

---