> 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 # Method name: addGroupMembers(groupId: string, memberIds: Array, options: AddGroupMembersOptions) # Method package: wixGroupsV2 # Method menu location: wixGroupsV2 --> members --> addGroupMembers # Method Link: https://dev.wix.com/docs/velo/apis/wix-groups-v2/members/add-group-members.md # Method Description: Add site members to a specific group. For `SECRET` groups, group admins and group members can add additional members to their group. For `PUBLIC` and `PRIVATE` groups, only group admins can add additional members to their group. They can also allow all group members to add a new member to the group with `group.settings`. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Add site members to a group (dashboard page code) ```javascript import { members } from 'wix-groups.v2'; // Sample groupId value: '0261a737-2361-4468-a3b1-5ec2b0667836' // // Sample memberIds value: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34'] async function addGroupMembers(groupId, memberIds) { try { const result = await members.addGroupMembers(groupId, memberIds); return result; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * members: [ * { * "joinedDate": "Sun Aug 01 2021 12:32:35 GMT+0300" * "memberId": "437cd3db-e9be-4980-93c1-a6d767a11050" * "role": {"value": "ADMIN"} * }, * { * "joinedDate": "Tues Jun 30 2019 10:09:33 GMT+0300" * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "role": {"value": "MEMBER"} * } * ] */ ``` ## Add site members to a group (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { members } from 'wix-groups.v2'; // Sample groupId value: '0261a737-2361-4468-a3b1-5ec2b0667836' // // Sample memberIds value: ['937cd3db-e9be-4980-93c1-a6d767a11050', '7fe8e9e1-d050-4c86-9684-e7f231600a34'] export const addGroupMembers = webMethod(Permissions.Anyone, async (groupId, memberIds) => { try { const result = await members.addGroupMembers(groupId, memberIds); return result; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * members: [ * { * "joinedDate": "Sun Aug 01 2021 12:32:35 GMT+0300" * "memberId": "437cd3db-e9be-4980-93c1-a6d767a11050" * "role": {"value": "ADMIN"} * }, * { * "joinedDate": "Tues Jun 30 2019 10:09:33 GMT+0300" * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "role": {"value": "MEMBER"} * } * ] */ ``` ---