---
type: api
title: Delete package
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-delete-package
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-delete-package
products:
  - Kibana
---

# Delete package

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

## Paths

- `DELETE` `/api/fleet/epm/packages/{pkgName}/{pkgVersion}`
- `DELETE` `/s/{space_id}/api/fleet/epm/packages/{pkgName}/{pkgVersion}`

#### Path parameters

- `pkgName` (string) — required
- `pkgVersion` (string) — required

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `force` (boolean) — optional
  delete package even if policies used by agents
- `ignoreUnverified` (boolean) — optional
  Ignore if the package is fails signature verification
- `full` (boolean) — optional
  Return all fields from the package manifest, not just those supported by the Elastic Package Registry
- `prerelease` (boolean · default: false) — optional
  Whether to return prerelease versions of packages (e.g. beta, rc, preview)

## Header parameters

- `kbn-xsrf` (string) — required
  Kibana's anti Cross-Site Request Forgery token. Can be any string value.

## Request body

`application/json`

- `force` (boolean) — optional

## Responses

#### `200`

OK

`application/json`

- `items` (object[])
  - `id` (string)
  - `type` (union enum)
    Values: `dashboard`, `visualization`, `search`, `index-pattern`, `map`, `lens`, `ml-module`, `security-rule`, `csp_rule_template`, `component_template`, `ingest_pipeline`, `index_template`, `ilm_policy`, `transform`, `data_stream_ilm_policy`
#### `400`

Generic Error

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
DELETE kbn:/api/fleet/epm/packages/PKG_NAME/PKG_VERSION
{}
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/fleet/epm/packages/${PKG_NAME}/${PKG_VERSION}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
```

