# Bulk create or update roles **POST /_security/role** 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. ## Required authorization * Cluster privileges: `manage_security` ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth - Basic auth - Bearer auth ## Parameters ### Query parameters - **refresh** (string) 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. ### Body: application/json (object) - **roles** (object) A dictionary of role name to RoleDescriptor objects to add or update ## Responses ### 200 #### Body: application/json (object) - **created** (array[string]) Array of created roles - **updated** (array[string]) Array of updated roles - **noop** (array[string]) Array of role names without any changes - **errors** (object) Present if any updates resulted in errors [Powered by Bump.sh](https://bump.sh)