5
5
<titleabbrev>Create or update users</titleabbrev>
6
6
++++
7
7
8
- Adds and updates users in the native realm. These users are commonly referred
8
+ Adds and updates users in the native realm. These users are commonly referred
9
9
to as _native users_.
10
10
11
11
@@ -14,7 +14,7 @@ to as _native users_.
14
14
15
15
`POST /_security/user/<username>` +
16
16
17
- `PUT /_security/user/<username>`
17
+ `PUT /_security/user/<username>`
18
18
19
19
20
20
[[security-api-put-user-prereqs]]
@@ -26,12 +26,12 @@ to as _native users_.
26
26
[[security-api-put-user-desc]]
27
27
==== {api-description-title}
28
28
29
- When updating a user, you can update everything but its `username` and `password`.
30
- To change a user's password, use the
31
- <<security-api-change-password, change password API>>.
29
+ A `password` is required for adding a new user but is optional when updating an
30
+ existing user. To change a user's password without updating any other fields,
31
+ use the <<security-api-change-password, change password API>>.
32
32
33
- For more information about the native realm, see
34
- <<realms>> and <<native-realm>>.
33
+ For more information about the native realm, see
34
+ <<realms>> and <<native-realm>>.
35
35
36
36
[[security-api-put-user-path-params]]
37
37
==== {api-path-parms-title}
@@ -73,7 +73,7 @@ The following parameters can be specified in the body of a POST or PUT request:
73
73
(object) Arbitrary metadata that you want to associate with the user.
74
74
75
75
`password`::
76
- (string) The user's password. Passwords must be at least 6 characters long.
76
+ (Required<<not-always-required,*>>, string) The user's password. Passwords must be at least 6 characters long.
77
77
+
78
78
When adding a user, one of `password` or `password_hash` is required.
79
79
When updating an existing user, the password is optional, so that other
@@ -98,6 +98,10 @@ used in the same request.
98
98
access permissions. To create a user without any roles, specify an empty list:
99
99
`[]`.
100
100
101
+ --
102
+ [[not-always-required]]
103
+ *Indicates that the setting is required in some, but not all situations.
104
+ --
101
105
102
106
[[security-api-put-user-example]]
103
107
==== {api-examples-title}
0 commit comments