> 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

# RejectGroupRequests

# Package: groups

# Namespace: GroupRequestsService

# Method link: https://dev.wix.com/docs/api-reference/crm/community/groups/create-group-requests/reject-group-requests.md

## Introduction

Rejects group requests.

Only Wix users can reject group requests.

---

## REST API

### Schema

```
 Method: rejectGroupRequests
 Description: Rejects group requests.  Only Wix users can reject group requests.
 URL: https://www.wixapis.com/_api/social-groups-proxy/group-requests/v2/group-requests/reject
 Method: POST
 Method parameters:
   param name: rejections | type: array<rejections> | description: Rejection data.  | validation: maxItems 100
              - name: groupRequestId | type: string | description: GUID of the group request to reject.  | validation: format GUID
              - name: reason | type: string | description: Rejection reason. Free text displayed to the creator of the rejected group request. Limited to 1,000 characters.  | validation: maxLength 1000
 Return type: RejectGroupRequestsResponse
  - name: groupRequest | type: array<GroupRequest> | description: Rejected group requests.  
     - name: id | type: string | description: Group request GUID.  | read-only: true | validation: format GUID
     - name: group | type: Group | description: Group requested for creation.  
        - name: id | type: string | description: Group GUID.  | read-only: true | validation: format GUID
        - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`.  | validation: minLength 1, maxLength 100
        - name: privacyStatus | type: PrivacyStatus | description: Group privacy status.  
             - enum:
             -     UNKNOWN: Undefined group privacy status.
             -     PUBLIC: Anyone can see the group and its content. Anyone can join the group.
             -     PRIVATE: Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`.
             -     SECRET: Only admins and members can see the group. New members can only be added by other members.
        - name: name | type: string | description: Group name.  | validation: maxLength 100
        - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format.  | validation: maxLength 20480
        - name: teaser | type: string | description: Group teaser.  | validation: maxLength 1000
        - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`.  | validation: minLength 1, maxLength 1000
        - name: coverImage | type: CoverImage | description: Cover image. You cannot upload your own cover image.  
           - name: image | type: Image | description: Cover image.  
              - name: mediaId | type: string | description: Image GUID (for internal use).  | validation: maxLength 1000
              - name: width | type: integer | description: Image width.  | validation: format int32
              - name: height | type: integer | description: Image height.  | validation: format int32
              - name: preset | type: boolean | description: Indicates pre-configured/auto-generated images (from templates, client generated).  
           - name: position | type: Position | description: Position of the corner of the cover image (or logo).  
              - name: x | type: float | description: horizontal coordinate  
              - name: y | type: float | description: vertical coordinate  
           - name: mobilePosition | type: Position | description: Position of the corner of the cover image (or logo) for mobile browser.  
           - name: altText | type: string | description: Alternative text is typically a relatively short phrase that describes what the image depicts.  The alternative text is used: + If the browser cannot display the image. + If the user is utilizing a screen reader. + By search engines to understand what images are on your site.  | validation: maxLength 200
        - name: settings | type: GroupSettings | description: Group specific settings.  These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?).  
           - name: welcomeMemberPostEnabled | type: boolean | description: Whether a daily post about new members is enabled.  
           - name: groupDetailsChangedPostEnabled | type: boolean | description: Whether an automatic post about changing the group details is enabled.  
           - name: showMemberList | type: boolean | description: Whether all members can see the full member list.  
           - name: allowedToInviteMembers | type: AllowPolicy | description: Determines who can invite members to the group  
                 - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS
           - name: allowedToApproveJoinRequests | type: AllowPolicy | description: Determines who can approve member join requests to the group  
           - name: aiSpamProtectionEnabled | type: boolean | description: Whether AI spam protection is enabled for post creation in the group. If not explicitly set, the default behavior is 'true' (enabled).  
        - name: membersCount | type: integer | description: Total count of current group members.  | read-only: true | validation: format int32
        - name: ownerId | type: string | description: Group owner.  | read-only: true | validation: format GUID
        - name: createdDate | type: string | description: Group creation date and time.  | read-only: true | validation: format date-time
        - name: updatedDate | type: string | description: Date and time of the latest group update.  | read-only: true | validation: format date-time
        - name: lastActivityDate | type: string | description: Date and time of the most recent group activity, for example a post or comment.  | read-only: true | validation: format date-time
     - name: status | type: RequestStatus | description: Status of group request.  
         - enum:
         -     PENDING: Pending group request.
         -     APPROVED: Approved group request.
         -     REJECTED: Rejected group request.
         -     CANCELED: Canceled group request.
     - name: requestDetails | type: RequestDetails | description: Group request details.  
        - name: rejectionReason | type: string | description: Reason the request has been rejected.  | validation: maxLength 1000


```

### Examples

### RejectGroupRequests
```curl
~~~cURL
curl -X POST \
    https://wixapis.com/social-groups/v2/groups-requests/reject \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Authorization: <AUTH>'
    -d '{
        "groupRequestIds": [
            "2447a832-09b9-448e-8051-71d5cdb1217b"
        ]
    }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.groups.groupRequests.rejectGroupRequests(rejections)
 Description: Rejects group requests.  Only Wix users can reject group requests.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  rejections
 Method parameters: 
   param name: rejections | type: array<Rejection> | description: Rejection data. | required: true | validation: maxItems 100
              - name: groupRequestId | type: string | description: GUID of the group request to reject.  | validation: format GUID
              - name: reason | type: string | description: Rejection reason. Free text displayed to the creator of the rejected group request. Limited to 1,000 characters.  | validation: maxLength 1000
 Return type: PROMISE<RejectGroupRequestsResponse>
  - name: groupRequest | type: array<GroupRequest> | description: Rejected group requests.  
     - name: _id | type: string | description: Group request GUID.  | read-only: true | validation: format GUID
     - name: group | type: Group | description: Group requested for creation.  
        - name: _id | type: string | description: Group GUID.  | read-only: true | validation: format GUID
        - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`.  | validation: minLength 1, maxLength 100
        - name: privacyStatus | type: PrivacyStatus | description: Group privacy status.  
             - enum:
             -     UNKNOWN: Undefined group privacy status.
             -     PUBLIC: Anyone can see the group and its content. Anyone can join the group.
             -     PRIVATE: Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`.
             -     SECRET: Only admins and members can see the group. New members can only be added by other members.
        - name: name | type: string | description: Group name.  | validation: maxLength 100
        - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format.  | validation: maxLength 20480
        - name: teaser | type: string | description: Group teaser.  | validation: maxLength 1000
        - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`.  | validation: minLength 1, maxLength 1000
        - name: coverImage | type: CoverImage | description: Cover image. You cannot upload your own cover image.  
           - name: image | type: Image | description: Cover image.  
              - name: mediaId | type: string | description: Image GUID (for internal use).  | validation: maxLength 1000
              - name: width | type: integer | description: Image width.  | validation: format int32
              - name: height | type: integer | description: Image height.  | validation: format int32
              - name: preset | type: boolean | description: Indicates pre-configured/auto-generated images (from templates, client generated).  
           - name: position | type: Position | description: Position of the corner of the cover image (or logo).  
              - name: x | type: float | description: horizontal coordinate  
              - name: y | type: float | description: vertical coordinate  
           - name: mobilePosition | type: Position | description: Position of the corner of the cover image (or logo) for mobile browser.  
           - name: altText | type: string | description: Alternative text is typically a relatively short phrase that describes what the image depicts.  The alternative text is used: + If the browser cannot display the image. + If the user is utilizing a screen reader. + By search engines to understand what images are on your site.  | validation: maxLength 200
        - name: settings | type: GroupSettings | description: Group specific settings.  These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?).  
           - name: welcomeMemberPostEnabled | type: boolean | description: Whether a daily post about new members is enabled.  
           - name: groupDetailsChangedPostEnabled | type: boolean | description: Whether an automatic post about changing the group details is enabled.  
           - name: showMemberList | type: boolean | description: Whether all members can see the full member list.  
           - name: allowedToInviteMembers | type: AllowPolicy | description: Determines who can invite members to the group  
                 - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS
           - name: allowedToApproveJoinRequests | type: AllowPolicy | description: Determines who can approve member join requests to the group  
           - name: aiSpamProtectionEnabled | type: boolean | description: Whether AI spam protection is enabled for post creation in the group. If not explicitly set, the default behavior is 'true' (enabled).  
        - name: membersCount | type: integer | description: Total count of current group members.  | read-only: true | validation: format int32
        - name: ownerId | type: string | description: Group owner.  | read-only: true | validation: format GUID
        - name: _createdDate | type: Date | description: Group creation date and time.  | read-only: true 
        - name: _updatedDate | type: Date | description: Date and time of the latest group update.  | read-only: true 
        - name: lastActivityDate | type: Date | description: Date and time of the most recent group activity, for example a post or comment.  | read-only: true 
     - name: status | type: RequestStatus | description: Status of group request.  
         - enum:
         -     PENDING: Pending group request.
         -     APPROVED: Approved group request.
         -     REJECTED: Rejected group request.
         -     CANCELED: Canceled group request.
     - name: requestDetails | type: RequestDetails | description: Group request details.  
        - name: rejectionReason | type: string | description: Reason the request has been rejected.  | validation: maxLength 1000


```

### Examples

### rejectGroupRequests
```javascript
import { groupRequests } from '@wix/groups';

async function rejectGroupRequests(rejections) {
  const response = await groupRequests.rejectGroupRequests(rejections);
};
```

### rejectGroupRequests (with elevated permissions)
```javascript
import { groupRequests } from '@wix/groups';
import { auth } from '@wix/essentials';

async function myRejectGroupRequestsMethod(rejections) {
  const elevatedRejectGroupRequests = auth.elevate(groupRequests.rejectGroupRequests);
  const response = await elevatedRejectGroupRequests(rejections);
}
```

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

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


async function rejectGroupRequests(rejections) {
  const response = await myWixClient.groupRequests.rejectGroupRequests(rejections);
};
```

---