---
type: api
title: Bulk upgrade packages
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-post-fleet-epm-packages-bulk-upgrade
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-post-fleet-epm-packages-bulk-upgrade
products:
  - Kibana
---

# Bulk upgrade packages

Authentication: required

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

## Paths

- `POST` `/api/fleet/epm/packages/_bulk_upgrade`
- `POST` `/s/{space_id}/api/fleet/epm/packages/_bulk_upgrade`

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

## Description

Upgrade multiple packages to their latest versions.

## Required authorization

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

## Header parameters

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

## Request body

`application/json`

- `acknowledge_breaking_changes` (boolean · default: false) — optional
  When true, acknowledge the breaking changes listed in the package changelog for the versions being upgraded. Without it, an upgrade whose version range includes breaking changes is rejected. The `force` flag does not bypass this check.
- `force` (boolean · default: false) — optional
- `packages` (object[] · min items: 1 · max items: 1000) — required
  - `name` (string · min length: 0) — required
  - `version` (string) — optional
- `prerelease` (boolean) — optional
- `upgrade_package_policies` (boolean · default: false) — optional

## Responses

#### `200`

Successful response

`application/json`

- `taskId` (string)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
POST kbn:/api/fleet/epm/packages/_bulk_upgrade
{
  "packages": [
    {
      "name": "system"
    },
    {
      "name": "elastic_agent"
    }
  ]
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/epm/packages/_bulk_upgrade" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "packages": [
      {
        "name": "system"
      },
      {
        "name": "elastic_agent"
      }
    ]
  }'
```

## Response examples

#### Post bulk upgrade packages

`application/json`

Bulk upgrade task initiated

```json
{
  "taskId": "task-id-1"
}
```

#### Generic error response

`application/json`

Example of a generic error response

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

