Create or update roles

Base URL
https://{kibana_url}
  • POST /api/security/roles
Auth

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

roles map string to object required
<string> object
description string · max length: 2048

A description for the role.

elasticsearch object required
cluster string[]
indices object[]
allow_restricted_indices boolean

Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field covers the restricted indices too.

field_security map string to string
names string[] · min items: 1 required
privileges string[] · min items: 1 required
query string

A search query that defines the documents the role members have read access to. A document within the specified data streams and indices must match this query in order for it to be accessible by the role members.

remote_cluster object[]
clusters string[] · min items: 1 required
privileges string[] · min items: 1 required
remote_indices object[]
allow_restricted_indices boolean

Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field will cover the restricted indices too.

clusters string[] · min items: 1 required
field_security map string to string
names string[] · min items: 1 required
privileges string[] · min items: 1 required
query string

A search query that defines the documents the role members have read access to. A document within the specified data streams and indices must match this query in order for it to be accessible by the role members.

run_as string[]
kibana object[] · max items: 1000
base union string[] required
One of: string[]
feature map string to string
spaces union enum[] | string[] · default: [ "*" ]
Values: *
metadata map string to object

Response

200

Indicates a successful call.

Base URL
https://{kibana_url}