API:User group membership

POST request to add or remove users from a group, thereby granting or removing certain user rights.

Example
To use this API, you first need to log in to verify your own user group membership. Only certain groups are granted the ability to alter user rights via this API. See for more details on logging in.

The query above applies to MediaWiki v1.24+; in older versions, the token would depend on the name of the user whose rights were being changed. The query would be made like so:

For compatibility reasons, the API will also accept the token used in the web UI.

Whichever method you choose, once you have your token, you can use it to make your request, as seen below.

Parameter history

 * v1.29: Introduced
 * v1.23: Introduced

Additional notes

 * By default, only users in the bureaucrat group can grant or remove user rights.


 * Some wikis allow non-bureaucrats to grant or remove rights on a limited basis, such as restricting those abilities to the user's own account.


 * If you do not possess the ability to grant or remove rights to the target user, the API will not throw an error; instead, the and  fields in the response will simply contain empty arrays.