How to get and create users using the Kibana API

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

  2. Create user: Create or update users API | Elasticsearch Guide [8.1] | Elastic

I keep getting the following response:

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

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

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

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

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
  }
}
'

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.

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