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,
): 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.

Returns
Return Type:Promise<UnassignRoleResponse>
JavaScript
import { roles } from "@wix/groups"; async function unassignRole(groupId, memberIds, role) { const response = await roles.unassignRole(groupId, memberIds, role); }
Errors

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

Did this help?