| 12345678910111213141516171819202122232425262728293031323334353637 | 
--:api: put-role:request: PutRoleRequest:response: PutRoleResponse--[role="xpack"][id="{upid}-{api}"]=== Put Role API[id="{upid}-{api}-request"]==== Put Role RequestThe +{request}+ class is used to create or update a role in the Native RolesStore. The request contains a single role, which encapsulates privileges overresources. A role can be assigned to an user using the<<{upid}-put-role-mapping, Put Role Mapping API>>.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-request]--------------------------------------------------include::../execution.asciidoc[][id="{upid}-{api}-response"]==== Put Role ResponseThe returned +{response}+ contains a single field, `created`. This fieldserves as an indication if the role was created or if an existing entry wasupdated.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-response]--------------------------------------------------<1> `created` is a boolean indicating whether the role was created or updated
 |