Create or update roles

  • POST also PUT /_security/role/{name}

The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management. The create or update roles API cannot update roles that are defined in roles files. File-based role management is not available in Elastic Serverless.

  • Cluster privileges: manage_security
Read the reference documentation

Path Parameters

name string Name required

The name of the role.

Query Parameters

refresh enum Refresh

If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

Values: true false wait_for

Response