- Kibana Guide: other versions:
- What is Kibana?
- What’s new in 8.15
- Kibana concepts
- Quick start
- Set up
- Install Kibana
- Configure Kibana
- Alerting and action settings
- APM settings
- Banners settings
- Cases settings
- Enterprise Search settings
- Fleet settings
- i18n settings
- Logging settings
- Logs settings
- Metrics settings
- Monitoring settings
- Reporting settings
- Search sessions settings
- Secure settings
- Security settings
- Spaces settings
- Task Manager settings
- Telemetry settings
- URL drilldown settings
- Start and stop Kibana
- Access Kibana
- Securing access to Kibana
- Add data
- Upgrade Kibana
- Configure security
- Configure reporting
- Configure logging
- Configure monitoring
- Command line tools
- Production considerations
- Discover
- Dashboard and visualizations
- Canvas
- Maps
- Build a map to compare metrics by country or region
- Track, visualize, and alert on assets in real time
- Map custom regions with reverse geocoding
- Heat map layer
- Tile layer
- Vector layer
- Plot big data
- Search geographic data
- Configure map settings
- Connect to Elastic Maps Service
- Import geospatial data
- Troubleshoot
- Reporting and sharing
- Machine learning
- Graph
- Alerting
- Observability
- Playground
- Security
- Dev Tools
- Fleet
- Osquery
- Stack Monitoring
- Stack Management
- Cases
- Connectors
- Amazon Bedrock
- Cases
- CrowdStrike
- D3 Security
- Google Gemini
- IBM Resilient
- Index
- Jira
- Microsoft Teams
- Observability AI Assistant
- OpenAI
- Opsgenie
- PagerDuty
- SentinelOne
- Server log
- ServiceNow ITSM
- ServiceNow SecOps
- ServiceNow ITOM
- Swimlane
- Slack
- Tines
- Torq
- Webhook
- Webhook - Case Management
- xMatters
- Preconfigured connectors
- License Management
- Maintenance windows
- Manage data views
- Numeral Formatting
- Rollup Jobs
- Manage saved objects
- Security
- Spaces
- Advanced Settings
- Tags
- Upgrade Assistant
- Watcher
- REST API
- Get features API
- Kibana spaces APIs
- Kibana role management APIs
- User session management APIs
- Saved objects APIs
- Data views API
- Index patterns APIs
- Alerting APIs
- Action and connector APIs
- Cases APIs
- Import and export dashboard APIs
- Logstash configuration management APIs
- Machine learning APIs
- Osquery manager API
- Short URLs APIs
- Get Task Manager health
- Upgrade assistant APIs
- Synthetics APIs
- Uptime APIs
- Kibana plugins
- Troubleshooting
- Accessibility
- Release notes
- Kibana 8.15.5
- Kibana 8.15.4
- Kibana 8.15.3
- Kibana 8.15.2
- Kibana 8.15.1
- Kibana 8.15.0
- Kibana 8.14.3
- Kibana 8.14.2
- Kibana 8.14.1
- Kibana 8.14.0
- Kibana 8.13.4
- Kibana 8.13.3
- Kibana 8.13.2
- Kibana 8.13.1
- Kibana 8.13.0
- Kibana 8.12.2
- Kibana 8.12.1
- Kibana 8.12.0
- Kibana 8.11.4
- Kibana 8.11.3
- Kibana 8.11.2
- Kibana 8.11.1
- Kibana 8.11.0
- Kibana 8.10.4
- Kibana 8.10.3
- Kibana 8.10.2
- Kibana 8.10.1
- Kibana 8.10.0
- Kibana 8.9.2
- Kibana 8.9.1
- Kibana 8.9.0
- Kibana 8.8.2
- Kibana 8.8.1
- Kibana 8.8.0
- Kibana 8.7.1
- Kibana 8.7.0
- Kibana 8.6.1
- Kibana 8.6.0
- Kibana 8.5.2
- Kibana 8.5.1
- Kibana 8.5.0
- Kibana 8.4.3
- Kibana 8.4.2
- Kibana 8.4.1
- Kibana 8.4.0
- Kibana 8.3.3
- Kibana 8.3.2
- Kibana 8.3.1
- Kibana 8.3.0
- Kibana 8.2.3
- Kibana 8.2.2
- Kibana 8.2.1
- Kibana 8.2.0
- Kibana 8.1.3
- Kibana 8.1.2
- Kibana 8.1.1
- Kibana 8.1.0
- Kibana 8.0.0
- Kibana 8.0.0-rc2
- Kibana 8.0.0-rc1
- Kibana 8.0.0-beta1
- Kibana 8.0.0-alpha2
- Kibana 8.0.0-alpha1
- Developer guide
Create or update role API
editCreate or update role API
edit[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Create a new Kibana role, or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm.
Request
editPUT <kibana host>:<port>/api/security/role/my_kibana_role
Prerequisite
editTo use the create or update role API, you must have the manage_security
cluster privilege.
Request body
edit-
description
- (Optional, string) Description for the role.
-
metadata
-
(Optional, object) In the
metadata
object, keys that begin with_
are reserved for system usage. -
elasticsearch
-
(Optional, object) Elasticsearch cluster and index privileges. Valid keys include
cluster
,indices
,remote_indices
,remote_cluster
, andrun_as
. For more information, see Defining roles. -
kibana
-
(list) Objects that specify the Kibana privileges for the role.
Properties of
kibana
-
base
-
(Optional, list) A base privilege. When specified, the base must be
["all"]
or["read"]
. When thebase
privilege is specified, you are unable to use thefeature
section. "all" grants read/write access to all Kibana features for the specified spaces. "read" grants read-only access to all Kibana features for the specified spaces. -
feature
-
(object) Contains privileges for specific features.
When the
feature
privileges are specified, you are unable to use thebase
section. To retrieve a list of available features, use the features API. -
spaces
-
(list) The spaces to apply the privileges to.
To grant access to all spaces, set to
["*"]
, or omit the value.
-
Query parameters
edit-
createOnly
-
(Optional, boolean) When
true
, will prevent overwriting the role if it already exists.
Response code
edit-
204
- Indicates a successful call.
-
409
-
When
createOnly
is true, indicates a conflict with an existing role.
Examples
editGrant access to various features in all spaces:
$ curl -X PUT api/security/role/my_kibana_role { "description": "my_kibana_role_description", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ ], "indices": [ ] }, "kibana": [ { "base": [ ], "feature": { "discover": [ "all" ], "visualize": [ "all" ], "dashboard": [ "all" ], "dev_tools": [ "read" ], "advancedSettings": [ "read" ], "indexPatterns": [ "read" ], "graph": [ "all" ], "apm": [ "read" ], "maps": [ "read" ], "canvas": [ "read" ], "infrastructure": [ "all" ], "logs": [ "all" ], "uptime": [ "all" ] }, "spaces": [ "*" ] } ] }
Grant dashboard-only access to only the Marketing space:
$ curl -X PUT api/security/role/my_kibana_role { "description": "Grants dashboard-only access to only the Marketing space.", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ ], "indices": [ ] }, "kibana": [ { "base": [ ], "feature": { "dashboard": [ "read" ] }, "spaces": [ "marketing" ] } ] }
Grant full access to all features in the Default space:
$ curl -X PUT api/security/role/my_kibana_role { "description": "Grants full access to all features in the Default space.", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ ], "indices": [ ] }, "kibana": [ { "base": [ "all" ], "feature": { }, "spaces": [ "default" ] } ] }
Grant different access to different spaces:
$ curl -X PUT api/security/role/my_kibana_role { "description": "Grants full access to discover and dashboard features in the default space. Grants read access in the marketing, and sales spaces.", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ ], "indices": [ ] }, "kibana": [ { "base": [ ], "feature": { "discover": [ "all" ], "dashboard": [ "all" ] }, "spaces": [ "default" ] }, { "base": [ "read"] , "spaces": [ "marketing", "sales" ] } ] }
Grant access to Kibana and Elasticsearch:
$ curl -X PUT api/security/role/my_kibana_role { "description": "Grants all cluster privileges and full access to index1 and index2. Grants full access to remote_index1 and remote_index2, and the monitor_enrich cluster privilege on remote_cluster1. Grants all Kibana privileges in the default space.", "metadata": { "version": 1 }, "elasticsearch": { "cluster": [ "all" ], "indices": [ { "names": [ "index1", "index2" ], "privileges": [ "all" ] } ], "remote_indices": [ { "clusters": [ "remote_cluster1" ], "names": [ "remote_index1", "remote_index2" ], "privileges": [ "all" ] } ], "remote_cluster": [ { "clusters": [ "remote_cluster1" ], "privileges": [ "monitor_enrich" ] } ] }, "kibana": [ { "base": [ "all" ], "feature": { }, "spaces": [ "default" ] } ] }