You're viewing version 3.8 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.
Get Users API
Introduced 1.0
Retrieves internal users. Specify a user name to retrieve one user, or omit the user name to retrieve all internal users.
Endpoints
GET /_plugins/_security/api/internalusers
GET /_plugins/_security/api/internalusers/{username}
Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Required | Description |
|---|---|---|---|
username | String | No | The name of the user to retrieve. If omitted, all internal users are returned. |
Example request
The following request retrieves all internal users:
GET _plugins/_security/api/internalusers
The following request retrieves the kirk user:
GET _plugins/_security/api/internalusers/kirk
Example response
The response lists every internal user. It is abbreviated here:
{
"logstash": {
"attributes": {},
"backend_roles": [
"logstash"
],
"description": "Demo logstash user, using external role mapping",
"hash": "",
"hidden": false,
"opendistro_security_roles": [],
"reserved": false,
"static": false
},
"snapshotrestore": {
"attributes": {},
"backend_roles": [
"snapshotrestore"
],
"description": "Demo snapshotrestore user, using external role mapping",
"hash": "",
"hidden": false,
"opendistro_security_roles": [],
"reserved": false,
"static": false
},
"admin": {
"attributes": {},
"backend_roles": [
"admin"
],
"description": "Demo admin user",
"hash": "",
"hidden": false,
"opendistro_security_roles": [],
"reserved": true,
"static": false
},
...
}
The response to a request for one user contains only that user:
{
"kirk": {
"attributes": {
"attribute1": "value1",
"attribute2": "value2"
},
"backend_roles": [
"captain",
"starfleet"
],
"hash": "",
"hidden": false,
"opendistro_security_roles": [
"maintenance_staff",
"database_manager"
],
"reserved": false,
"static": false
}
}