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

# Bulk delete package policies

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

## Paths

- `POST` `/api/fleet/package_policies/delete`
- `POST` `/s/{space_id}/api/fleet/package_policies/delete`

## Description

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

Delete multiple package policies by ID.

## Required authorization

- Privileges: `fleet-agent-policies-all` and `integrations-all`

## 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>`

## Header parameters

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

## Request body

`application/json`

- `force` (boolean) — optional
- `packagePolicyIds` (string[] · max items: 1000) — required

## Responses

#### `200`

Successful response

`application/json`

Type: `object[] · max items: 10000`

An array; each item has these fields:

- `body` (object)
  - `message` (string)
- `id` (string)
- `name` (string)
- `output_id` (string) — nullable
- `package` (object)
  - `experimental_data_stream_features` (object[] · max items: 100)
    - `data_stream` (string · max length: 1024)
    - `features` (object)
      - `doc_value_only_numeric` (boolean)
      - `doc_value_only_other` (boolean)
      - `synthetic_source` (boolean)
      - `tsdb` (boolean)
  - `fips_compatible` (boolean)
  - `name` (string · max length: 255)
    Package name
  - `requires_root` (boolean)
  - `title` (string · max length: 255)
  - `version` (string · max length: 50)
    Package version
- `policy_id` (string) — nullable — deprecated
  Use `policy_ids` instead
- `policy_ids` (string[] · max items: 10000)
- `statusCode` (number)
- `success` (boolean)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
POST kbn:/api/fleet/package_policies/delete
{
  "packagePolicyIds": [
    "package-policy-id-1",
    "package-policy-id-2"
  ]
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/package_policies/delete" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "packagePolicyIds": [
      "package-policy-id-1",
      "package-policy-id-2"
    ]
  }'
```

## Response examples

#### Post delete package policies

Results of the bulk delete operation

```json
[
  {
    "id": "package-policy-id-1",
    "success": true
  },
  {
    "id": "package-policy-id-2",
    "success": true
  }
]
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

