Create or update users

  • POST also PUT /_security/user/{username}

Add and update users in the native realm. A password is required for adding a new user but is optional when updating an existing user. To change a user's password without updating any other fields, use the change password API.

  • Cluster privileges: manage_security

Path Parameters

username string required

An identifier for the user.

NOTE: Usernames must be at least 1 and no more than 507 characters. They can contain alphanumeric characters (a-z, A-Z, 0-9), spaces, punctuation, and printable symbols in the Basic Latin (ASCII) block. Leading or trailing whitespace is not allowed.

Query Parameters

refresh enum Refresh · default: true

Valid values are true, false, and wait_for. These values have the same meaning as in the index API, but the default value for this API is true.

Values: true false wait_for

Response