XF 2.2 Mark user is_staff through rest API

untuned

Member
I would like to mark a user as staff through an external application, but upon sending the request the user gets returned without the is_staff field being updated.

Here is the code that I am using to make said request:
JavaScript:
const params = new URLSearchParams();
params.append('is_staff', true)
const request = await axios.post(`https://XXXXXXXXXXXX/api/users/${userID}`, params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'XF-Api-Key': 'XXXXXXXXXXXX',
      'XF-Api-User': '9',
    },
});

The result of request.data.user.is_staff is still false.
 
Top Bottom