---
type: api
title: Delete package
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-delete-package
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/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}`

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

## Description

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

## Query String Parameters

- `force` (boolean)
  delete package even if policies used by agents

## Request Body

`application/json`

- `force` (boolean) — optional

## Responses

#### `200`

OK

`application/json`

- `items` ([] object)
  - `id` (string)
  - `type` (union object | object)
    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 /api/fleet/epm/packages/{pkgName}/{pkgVersion}
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/fleet/epm/packages/{pkgName}/{pkgVersion}" \
  -H "kbn-xsrf: true"
```

