Add an Additional Role to Existing User through API

Hi,

I'm just wondering if there's a way of adding roles to existing users through an API call. I know you can edit users roles through this API call:

POST /_xpack/security/user/<USER>
{
  "roles" : [ "<ROLE1>","<ROLE2>" ]
}

However, you have to recall the users full role array then append the new role if you want to keep the existing roles already assigned to the user. Is there a way just to provide a new role to the API and have it just append the new role to the users existing roles?

Thanks in advanced.

There is not currently a way to do this via the API. If you are doing this manually, the Kibana user management section makes this easier as you can simply assign the new role via the ui.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.