Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm.
PUT /api/security/role/{name}
curl \ --request PUT 'https://localhost:5601/api/security/role/{name}' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --header "kbn-xsrf: true" \ --data '{"kibana":[{"base":[],"spaces":["default"],"feature":{"discover":["all"],"dashboard":["all"]}},{"base":["read"],"spaces":["marketing","sales"]}],"metadata":{"version":1},"description":"Grant full access to discover and dashboard features in the default space. Grant read access in the marketing, and sales spaces.","elasticsearch":{"cluster":[],"indices":[]}}' Request examples
Feature privileges in multiple spaces
Grant access to various features in some spaces.
{ "kibana": [ { "base": [], "spaces": [ "default" ], "feature": { "discover": [ "all" ], "dashboard": [ "all" ] } }, { "base": [ "read" ], "spaces": [ "marketing", "sales" ] } ], "metadata": { "version": 1 }, "description": "Grant full access to discover and dashboard features in the default space. Grant read access in the marketing, and sales spaces.", "elasticsearch": { "cluster": [], "indices": [] } } Grant access to dashboard features in a Marketing space.
{ "kibana": [ { "base": [], "spaces": [ "marketing" ], "feature": { "dashboard": [ "read" ] } } ], "metadata": { "version": 1 }, "description": "Grant dashboard access in the Marketing space.", "elasticsearch": { "cluster": [], "indices": [] } } Grant full access to all features in the default space.
{ "kibana": [ { "base": [ "all" ], "spaces": [ "default" ], "feature": {} } ], "metadata": { "version": 1 }, "elasticsearch": { "cluster": [], "indices": [] } } Grant Elasticsearch and Kibana feature privileges.
{ "kibana": [ { "base": [ "all" ], "spaces": [ "default" ], "feature": {} } ], "metadata": { "version": 1 }, "description": "Grant all cluster privileges and full access to index1 and index2. Grant full access to remote_index1 and remote_index2, and the monitor_enrich cluster privilege on remote_cluster1. Grant all Kibana privileges in the default space.", "elasticsearch": { "cluster": [ "all" ], "indices": [ { "names": [ "index1", "index2" ], "privileges": [ "all" ] } ], "remote_cluster": [ { "clusters": [ "remote_cluster1" ], "privileges": [ "monitor_enrich" ] } ], "remote_indices": [ { "names": [ "remote_index1", "remote_index2" ], "clusters": [ "remote_cluster1" ], "privileges": [ "all" ] } ] } }