OpenSearch/x-pack/docs/en/rest-api/security/enable-users.asciidoc

49 lines
1.2 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[[security-api-enable-user]]
=== Enable users API
2018-12-20 13:23:28 -05:00
++++
<titleabbrev>Enable users</titleabbrev>
++++
Enables users in the native realm.
[[security-api-enable-user-request]]
==== {api-request-title}
`PUT /_security/user/<username>/_enable`
[[security-api-enable-user-prereqs]]
==== {api-prereq-title}
* To use this API, you must have at least the `manage_security` cluster privilege.
[[security-api-enable-user-desc]]
==== {api-description-title}
By default, when you create users, they are enabled. You can use this enable
users API and the <<security-api-disable-user,disable users API>> to change that attribute.
For more information about the native realm, see
{stack-ov}/realms.html[Realms] and <<configuring-native-realm>>.
[[security-api-enable-user-path-params]]
==== {api-path-parms-title}
`username`::
(Required, string) An identifier for the user.
[[security-api-enable-user-example]]
==== {api-examples-title}
The following example enables the user `jacknich`:
[source,js]
--------------------------------------------------
PUT /_security/user/jacknich/_enable
--------------------------------------------------
// CONSOLE
// TEST[setup:jacknich_user]