> 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 # ApproveGroupRequests # Package: groups # Namespace: GroupRequestsService # Method link: https://dev.wix.com/docs/api-reference/crm/community/groups/create-group-requests/approve-group-requests.md ## Introduction Approves group requests. Only Wix users can approve group requests. --- ## REST API ### Schema ``` Method: approveGroupRequests Description: Approves group requests. Only Wix users can approve group requests. URL: https://www.wixapis.com/v2/group-requests/approve Method: POST Method parameters: param name: groupRequestIds | type: array | description: Group request GUIDs to approve. Limited to `100`. Return type: ApproveGroupRequestsResponse - name: groupRequest | type: array | description: Approved group requests. - name: id | type: string | description: Group request GUID. - name: group | type: Group | description: Group requested for creation. - name: id | type: string | description: Group GUID. - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`. - 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. - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format. - name: teaser | type: string | description: Group teaser. - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`. - 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). - name: width | type: integer | description: Image width. - name: height | type: integer | description: Image height. - 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. - 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. - name: ownerId | type: string | description: Group owner. - name: createdDate | type: string | description: Group creation date and time. - name: updatedDate | type: string | description: Date and time of the latest group update. - name: lastActivityDate | type: string | description: Date and time of the most recent group activity, for example a post or comment. - 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. ``` ### Examples ### ApproveGroupRequests ```curl ~~~cURL curl -X POST \ https://wixapis.com/social-groups/v2/groups-requests/approve \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "groupRequestIds": [ "2447a832-09b9-448e-8051-71d5cdb1217b" ] }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.groups.GroupRequestsService.approveGroupRequests(groupRequestIds) Description: Approves group requests. Only Wix users can approve group requests. Method parameters: param name: groupRequestIds | type: array | description: Group request GUIDs to approve. Limited to `100`. Return type: PROMISE - name: groupRequest | type: array | description: Approved group requests. - name: _id | type: string | description: Group request GUID. - name: group | type: Group | description: Group requested for creation. - name: _id | type: string | description: Group GUID. - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`. - 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. - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format. - name: teaser | type: string | description: Group teaser. - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`. - 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). - name: width | type: integer | description: Image width. - name: height | type: integer | description: Image height. - 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. - 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. - name: ownerId | type: string | description: Group owner. - name: _createdDate | type: Date | description: Group creation date and time. - name: _updatedDate | type: Date | description: Date and time of the latest group update. - name: lastActivityDate | type: Date | description: Date and time of the most recent group activity, for example a post or comment. - 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. ``` ### Examples ### approveGroupRequests ```javascript import { groupRequests } from '@wix/groups'; async function approveGroupRequests(groupRequestIds) { const response = await groupRequests.approveGroupRequests(groupRequestIds); }; ``` ### approveGroupRequests (with elevated permissions) ```javascript import { groupRequests } from '@wix/groups'; import { auth } from '@wix/essentials'; async function myApproveGroupRequestsMethod(groupRequestIds) { const elevatedApproveGroupRequests = auth.elevate(groupRequests.approveGroupRequests); const response = await elevatedApproveGroupRequests(groupRequestIds); } ``` ### approveGroupRequests (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 { 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 approveGroupRequests(groupRequestIds) { const response = await myWixClient.groupRequests.approveGroupRequests(groupRequestIds); }; ``` ---