unassignRole( )


Unassigns a role from group members.

You can only unassign ADMIN roles. Calling this method with group members with role.value set to MEMBER returns an error.

Notes:

  • Only group admins can assign roles.
  • You cannot remove members with this method.
Method Declaration
Copy
function unassignRole(
  groupId: string,
  memberIds: Array<string>,
  role: GroupRole,
  options: UnassignRoleOptions,
): Promise<UnassignRoleResponse>;
Method Parameters
groupIdstringRequired

Group ID.


memberIdsArray<string>Required

Member IDs. Limited to 100 member IDs. See the Members API for details.


roleGroupRoleRequired

Role to unassign.


optionsUnassignRoleOptions
Returns
Return Type:Promise<UnassignRoleResponse>
JavaScript
import { roles } from "wix-groups.v2"; // Sample ID values: // memberIds: ['7fe8e9e1-d050-4c86-9684-e7f231600a34'], // groupId: '0261a737-2361-4468-a3b1-5ec2b0667836.' // // Sample role value: // role: 'MEMBER' // export function unassignRole(groupId, memberIds, role) { return roles .unassignRole(groupId, memberIds, role) .then((response) => { console.log(response); }) .catch((error) => { console.error(error); }); } /* Promise resolves to: * role: "MEMBER" */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?