Create or update an ES|QL view

Auth

Stores an ES|QL query that runs whenever the view is referenced. A query that cannot be parsed is rejected. Replacing a reserved view fails.

Define reusable queries with ES|QL views

Required privileges

Index privileges create_view

Path parameters

name string required

The view name to create or update.

Query parameters

validate boolean · default: false

Whether to analyze the view query and return a warning when validation fails.

Validation reports an unknown index or column, including an index the caller cannot read. The view is saved even when validation reports a problem. Failures unrelated to the query, such as an overloaded cluster, produce no warning.

Request body

query string required

The ES|QL query string that defines the view. A query that cannot be parsed is rejected.

description string

A free-text description of the view.

Response

application/json
acknowledged boolean required

For a successful response, this value is always true. On failure, an exception is returned instead.