---
type: api
title: Create or update an ES|QL view
description: ## Required authorization
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-esql-put-view
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-esql-put-view
products:
  - Elasticsearch
---

# Create or update an ES|QL view

Availability: 9.4+

## Paths

- `PUT` `/_query/view/{name}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `name` (string Id)
  The view name to create or update.

## Description



## Required authorization

* Index privileges: `create_view`

## Request Body

`application/json`

- `query` (string) — required
  The ES|QL query string from which to create a view.
- `description` (string) — optional
  A free-text description of the view.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code Examples

#### Console

```console
PUT /_query/view/{name}
```

#### curl

```curl
curl -X PUT "/_query/view/{name}"
```

