Type to search.

Create or update an ES|QL view

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 9.4 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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 The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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 The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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.