# REST API for adding users

**URL:** <https://discuss.elastic.co/t/rest-api-for-adding-users/262570>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [January 28, 2021, 9:32pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570 "2021-01-28T21:32:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![umesh2020](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umesh2020/32/126038_2.png) [@umesh2020](https://discuss.elastic.co/u/umesh2020)\
**Post date:** [January 28, 2021, 9:32pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/1 "2021-01-28T21:32:50Z")

</div>

Hi  
Is there a REST API for adding users provided by Kibana ? OR I can use the elasticsearch create user API to add users ?

Thanks,  
Umesh

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 28, 2021, 9:44pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/2 "2021-01-28T21:44:40Z")

</div>

Yes, you can directly add users using Elasticsearch, and the full docs are under [Elasticsearch authentication](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html). Notice that there are multiple types of authentication supported.

From the Kibana perspective, you will need to assign [Kibana privileges](https://www.elastic.co/guide/en/kibana/current/kibana-privileges.html) and the appropriate Kibana roles to these users. The docs here are in [Granting access to Kibana](https://www.elastic.co/guide/en/kibana/current/xpack-security-authorization.html).

You can also integrate with [external identify providers](https://www.elastic.co/guide/en/kibana/current/role-mappings.html) where you will need to provide a Role Mapping to access Kibana.

---

<div class="post-metadata">

**Author:** ![umesh2020](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umesh2020/32/126038_2.png) [@umesh2020](https://discuss.elastic.co/u/umesh2020)\
**Post date:** [January 28, 2021, 10:19pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/3 "2021-01-28T22:19:26Z")

</div>

> [@wylie](#):
>
> Kibana

Thanks for the details. Will go through them.  
I have used Kibana role management API to create the role that provides access to Kibana space and required indexes for the role. In this case, would it suffice to add the user to elasticsearch with the role I have created. Is my understanding correct ?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 29, 2021, 3:12pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/4 "2021-01-29T15:12:51Z")

</div>

That sounds correct.

---

<div class="post-metadata">

**Author:** ![umesh2020](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umesh2020/32/126038_2.png) [@umesh2020](https://discuss.elastic.co/u/umesh2020)\
**Post date:** [January 29, 2021, 7:23pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/5 "2021-01-29T19:23:47Z")

</div>

Thank you so much. I was able to add user using elasticsearch API.

---

<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:** [February 26, 2021, 7:24pm UTC](https://discuss.elastic.co/t/rest-api-for-adding-users/262570/6 "2021-02-26T19:24:29Z")

</div>

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