# How to get and create users using the Kibana API

**URL:** https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [March 11, 2022, 7:30am UTC](https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408 "2022-03-11T07:30:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)
#### Post date: [March 11, 2022, 7:30am UTC](https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408/1 "2022-03-11T07:30:55Z")

</div>

Hello,

I'm using the Elastic cloud service and the version I'm using is 7.16.2

I'm trying to get and create users from the following documentation using Postman and a Python script,

1. GET user: [Get users API | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html)

2. Create user: [Create or update users API | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html#security-api-put-user-example)

I keep getting the following response:

```auto
{
    "statusCode": 404,
    "error": "Not Found",
    "message": "Not Found"
}

```

For instance, I'm using the following url to GET all users

```auto
<kibana host>:<port>/_security/user

```

---

<div class="post-metadata">

### Author: ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)
#### Post date: [March 11, 2022, 8:44am UTC](https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408/2 "2022-03-11T08:44:38Z")

</div>

you can use `ES API` or `kibana Stack Management `to create user ：

```auto
curl -X POST "localhost:9200/_security/user/jacknich?pretty" -H 'Content-Type: application/json' -d'
{
  "password" : "l0ng-r4nd0m-p@ssw0rd",
  "roles" : ["admin", "other_role1"],
  "full_name" : "Jack Nicholson",
  "email" : "jacknich@example.com",
  "metadata" : {
    "intelligence" : 7
  }
}
'

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5c444386ff71501bd7c8b60728d0666f78885f83.png)

---

<div class="post-metadata">

### Author: ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)
#### Post date: [March 11, 2022, 2:25pm UTC](https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408/3 "2022-03-11T14:25:20Z")

</div>

I see the error of my ways, I need to hit the Elasticsearch endpoint and not Kibana.

I must have been looking at old documentation and the new documentation all points to the Elasticsearch endpoint.

---

<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: [April 8, 2022, 2:25pm UTC](https://discuss.elastic.co/t/how-to-get-and-create-users-using-the-kibana-api/299408/4 "2022-04-08T14:25:24Z")

</div>

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