How to remove a user from a user group? Ok this should be pretty simple I feel! But I can't find the documentation for it.

I can set assign a user to a user group within a plugin with:

craft()-&gt;userGroups-&gt;assignUserToGroups($userid, $groupid);


How do I do the reverse and remove a user from a user group?

Cheers.
assignUserToGroups has $groupIds parameter (int / array) preset to null. From the docs:


  assignUserToGroups($userId, $groupIds = null)


So calling the function without that parameter set should do it:

craft()-&gt;userGroups-&gt;assignUserToGroups(1);