---
type: api
title: Delete a data view
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-delete-data-views-v2-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-delete-data-views-v2-id
products:
  - Kibana
---

# Delete a data view

Authentication: required

Availability: Planned

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/data_views/v2/{id}`
- `DELETE` `/s/{space_id}/api/data_views/v2/{id}`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `id` (string · min length: 1 · max length: 1000) — required
  The ID of the data view to delete.

## Description

Permanently deletes a data view by ID. You can't recover a deleted data view.

## Required authorization

- Privileges: `indexPatterns:manage`

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Responses

#### `204`

deleted

#### `403`

forbidden

#### `404`

not found

## Code examples

#### Console

```console
DELETE kbn:/api/data_views/v2/ID
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/data_views/v2/${ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

