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://<KIBANA_URL>/api/security/role/{name}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '"{\n \"description\": \"My custom Kibana role.\",\n \"elasticsearch\": {\n \"cluster\": [\n \"monitor\"\n ],\n \"indices\": [\n {\n \"names\": [\n \"logs-*\"\n ],\n \"privileges\": [\n \"read\"\n ]\n }\n ]\n },\n \"kibana\": [\n {\n \"base\": [\n \"read\"\n ],\n \"feature\": {},\n \"spaces\": [\n \"default\"\n ]\n }\n ]\n}"'
Request example
{
"description": "My custom Kibana role.",
"elasticsearch": {
"cluster": [
"monitor"
],
"indices": [
{
"names": [
"logs-*"
],
"privileges": [
"read"
]
}
]
},
"kibana": [
{
"base": [
"read"
],
"feature": {},
"spaces": [
"default"
]
}
]
}