Create or update a role Beta
Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm.
Path parameters
-
The role name.
Minimum length is
1
, maximum length is1024
.
Query parameters
-
createOnly boolean
When true, a role is not overwritten if it already exists.
Default value is
false
.
Body
-
description string
A description for the role.
Maximum length is
2048
. -
Additional properties are NOT allowed.
-
kibana array[object]
-
metadata object
Additional properties are allowed.
PUT
/api/security/role/{name}
curl \
-X PUT https://<KIBANA_URL>/api/security/role/{name} \
-H "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
-H "kbn-xsrf: true"
Request examples
# Headers
kbn-xsrf: true
# Payload
{
"description": "string",
"elasticsearch": {
"cluster": [
"string"
],
"indices": [
{
"allow_restricted_indices": true,
"field_security": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"names": [
"string"
],
"privileges": [
"string"
],
"query": "string"
}
],
"remote_cluster": [
{
"clusters": [
"string"
],
"privileges": [
"string"
]
}
],
"remote_indices": [
{
"allow_restricted_indices": true,
"clusters": [
"string"
],
"field_security": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"names": [
"string"
],
"privileges": [
"string"
],
"query": "string"
}
],
"run_as": [
"string"
]
},
"kibana": [
{
"base": [],
"feature": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"spaces": [
"*"
]
}
],
"metadata": {}
}