[[reference-security-put_role]] //////// =========================================================================================================================== || || || || || || || ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ || || ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ || || ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ || || ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ || || ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ || || ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ || || || || || || This file is autogenerated, DO NOT send pull requests that changes this file directly. || || You should update the script that does the generation, which can be found in: || || https://github.com/elastic/elastic-client-generator-js || || || || You can run the script with the following command: || || npm run elasticsearch -- --version || || || || || || || =========================================================================================================================== //////// [discrete] [[client.security.putRole]] === client.security.putRole Create or update roles. 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. {ref}/security-api-put-role.html[{es} documentation] [discrete] ==== Function signature [source,ts] ---- (SecurityPutRoleRequest, options?): Promise ---- [discrete] ==== Request [pass] ++++
++++
interface SecurityPutRoleRequest extends <> {
  name: <>
  refresh?: <>
  applications?: <>[]
  cluster?: <>[]
  global?: Record
  indices?: <>[]
  remote_indices?: <>[]
  metadata?: <>
  run_as?: string[]
  description?: string
  transient_metadata?: Record
}

[pass]
++++
++++ [discrete] ==== Response [pass] ++++
++++
interface SecurityPutRoleResponse {
  role: <>
}

[pass]
++++
++++