> 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 # RejectJoinGroupRequests # Package: memberManagement # Namespace: JoinGroupRequestsService # Method link: https://dev.wix.com/docs/api-reference/crm/community/groups/member-management/join-requests/reject-join-group-requests.md ## Introduction Rejects pending join group requests. Group managers always have access to this functionality. In some cases, site owners will allow group members to use this functionality as well. --- ## REST API ### Schema ``` Method: rejectJoinGroupRequests Description: Rejects pending join group requests. Group managers always have access to this functionality. In some cases, site owners will allow group members to use this functionality as well. URL: https://www.wixapis.com/v2/groups/{groupId}/join-requests/reject Method: POST Method parameters: param name: rejections | type: array | description: Rejection info. - name: memberId | type: string | description: Member GUID to reject. - name: reason | type: string | description: Rejection reason. Free text that will be displayed to the rejected site member. Limited to 1,000 characters. Return type: RejectJoinGroupRequestsResponse - name: joinGroupRequests | type: array | description: Rejected join group requests. - name: siteMemberId | type: string | description: Member GUID. See the Members API for more details. - name: contactId | type: string | description: Contact GUID. See the Contacts API for more details. - name: status | type: RequestStatus | description: Join group request status. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Join group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. ``` ### Examples ### RejectJoinGroupRequests ```curl ~~~cURL curl -X POST \ https://wixapis.com/social-groups/v2/groups/a4caf853-c0d7-498e-8eaa-3db36522dcbf/join-requests/reject \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "siteMemberIds": [ "e6674661-f294-4f1f-9f22-bc11fa8164e7" ] }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.memberManagement.JoinGroupRequestsService.rejectJoinGroupRequests(groupId, rejections) Description: Rejects pending join group requests. Group managers always have access to this functionality. In some cases, site owners will allow group members to use this functionality as well. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: groupId Method parameters: param name: groupId | type: string | description: GUID of the group requested to join. | required: true param name: rejections | type: array | description: Rejection info. - name: memberId | type: string | description: Member GUID to reject. - name: reason | type: string | description: Rejection reason. Free text that will be displayed to the rejected site member. Limited to 1,000 characters. Return type: PROMISE - name: joinGroupRequests | type: array | description: Rejected join group requests. - name: siteMemberId | type: string | description: Member GUID. See the Members API for more details. - name: contactId | type: string | description: Contact GUID. See the Contacts API for more details. - name: status | type: RequestStatus | description: Join group request status. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Join group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. ``` ### Examples ### Reject a request to join a group (with elevated permissions) ```javascript import { joinGroupRequests } from '@wix/groups'; import { auth } from '@wix/essentials'; const elevatedRejectJoinGroupRequests = auth.elevate(joinGroupRequests.rejectJoinGroupRequests); // Sample groupId: "6z2334b13bb4b44569a7cdf292j227" // // Sample rejections value: // [ // { // memberId: '77490611-53bb-4b47-a7cc-ca9a1335133b', // reason: 'This group is for college students only.' // } // ] async function rejectJoinGroupRequests(groupId, rejections, options) { try { const result = await elevatedRejectJoinGroupRequests(groupId, rejections); return result; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * joinGroupRequests: [ * { * "requestDetails": {"rejectionReason": "This group is for college students only."} * "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099" * "status": "REJECTED" * } * ] */ ``` ### Reject a request to join a group ```javascript import { joinGroupRequests } from '@wix/groups'; // Sample groupId: "6z2334b13bb4b44569a7cdf292j227" // // Sample rejections value: // [ // { // memberId: '77490611-53bb-4b47-a7cc-ca9a1335133b', // reason: 'This group is for college students only.' // } // ] async function rejectJoinGroupRequests(groupId, rejections, options) { try { const result = await joinGroupRequests.rejectJoinGroupRequests(groupId, rejections); return result; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * joinGroupRequests: [ * { * "requestDetails": {"rejectionReason": "This group is for college students only."} * "siteMemberId": "124cd3db-e9be-4980-93c1-a6d767a11099" * "status": "REJECTED" * } * ] */ ``` ### rejectJoinGroupRequests (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 { joinGroupRequests } from '@wix/groups'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { joinGroupRequests }, // Include the auth strategy and host as relevant }); async function rejectJoinGroupRequests(groupId,rejections) { const response = await myWixClient.joinGroupRequests.rejectJoinGroupRequests(groupId,rejections); }; ``` ---