[[reference-security-bulk_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 <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
[[client.security.bulkPutRole]]
=== client.security.bulkPutRole

Bulk create or update roles. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk create or update roles API cannot update roles that are defined in roles files.

{ref}/security-api-bulk-put-role.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(SecurityBulkPutRoleRequest, options?): Promise<SecurityBulkPutRoleResponse>
----

[discrete]
==== SecurityBulkPutRoleRequest

[pass]
++++
<pre>
++++
interface SecurityBulkPutRoleRequest extends <<RequestBase>> {
  refresh?: <<Refresh>>
  roles: Record<string, <<SecurityRoleDescriptor>>>
}

[pass]
++++
</pre>
++++
[discrete]
==== SecurityBulkPutRoleResponse

[pass]
++++
<pre>
++++
interface SecurityBulkPutRoleResponse {
  created?: string[]
  updated?: string[]
  noop?: string[]
  errors?: <<SecurityBulkError>>
}

[pass]
++++
</pre>
++++
