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

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

## Description

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

Delete multiple package policies by ID.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-all AND integrations-all.

## Request Body

`application/json`

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

## Responses

#### `200`

Successful response

`application/json`

Type: `[] object · max: 10000`

- `body` (object)
  - `message` (string)
- `id` (string)
- `name` (string)
- `output_id` (string) — nullable
- `package` ({})
  - `experimental_data_stream_features` ([] object · max: 100)
    - `data_stream` (string · max: 1024)
    - `features` (object)
      - `doc_value_only_numeric` (boolean)
      - `doc_value_only_other` (boolean)
      - `synthetic_source` (boolean)
      - `tsdb` (boolean)
  - `fips_compatible` (boolean)
  - `name` (string · max: 255)
    Package name
  - `requires_root` (boolean)
  - `title` (string · max: 255)
  - `version` (string · max: 50)
    Package version
- `policy_id` (string) — nullable — deprecated
  Use `policy_ids` instead
- `policy_ids` ([] string · max: 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 /api/fleet/package_policies/delete
{
  "packagePolicyIds": [
    "package-policy-id-1",
    "package-policy-id-2"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/package_policies/delete" \
  -H "kbn-xsrf: true" \
  -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
}
```

