# Add an Additional Role to Existing User through API

**URL:** <https://discuss.elastic.co/t/add-an-additional-role-to-existing-user-through-api/105479>\
**Category:** Elasticsearch\
**Created:** [October 26, 2017, 9:16pm UTC](https://discuss.elastic.co/t/add-an-additional-role-to-existing-user-through-api/105479 "2017-10-26T21:16:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nomAAd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nomaad/32/22738_2.png) [@nomAAd](https://discuss.elastic.co/u/nomAAd)\
**Post date:** [October 26, 2017, 9:16pm UTC](https://discuss.elastic.co/t/add-an-additional-role-to-existing-user-through-api/105479/1 "2017-10-26T21:16:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [October 27, 2017, 2:46pm UTC](https://discuss.elastic.co/t/add-an-additional-role-to-existing-user-through-api/105479/2 "2017-10-27T14:46:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 24, 2017, 2:46pm UTC](https://discuss.elastic.co/t/add-an-additional-role-to-existing-user-through-api/105479/3 "2017-11-24T14:46:23Z")

</div>

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