---
type: api
title: Delete a Vega library item
description: "Permanently deletes a Vega library item by its ID. Dashboards that link to the item by reference can no longer display the panel."
url: https://www.elastic.co/elastic/docs-builder/docs/5002/api/kibana-serverless/operation/operation-delete-vega-id
resource: https://www.elastic.co/elastic/docs-builder/docs/5002/api/kibana-serverless/operation/operation-delete-vega-id
products:
  - Kibana
---

# Delete a Vega library item

Authentication: required

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

## Paths

- `DELETE` `/api/vega/{id}`
- `DELETE` `/s/{space_id}/api/vega/{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) — required
  The Vega library item ID, as returned by the create or search endpoints, or the ID you chose when you created the item with the upsert endpoint.

## Description

Permanently deletes a Vega library item by its ID. Dashboards that link to the item by reference can no longer display the panel.

## Header parameters

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

## Responses

#### `204`

No content, the Vega library item was successfully deleted.

#### `403`

forbidden

#### `404`

not found

## Code examples

#### Console

```console
DELETE kbn:/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/vega/7c1d8e40-9b2f-11f0-a5c3-2f6e4b8d9a10" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"
```

