---
type: api
title: Bulk upgrade packages
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-epm-packages-bulk-upgrade
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-post-fleet-epm-packages-bulk-upgrade
products:
  - Kibana
---

# Bulk upgrade packages

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

## Paths

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

## Description

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

Upgrade multiple packages to their latest versions.

## Required authorization

- Privileges: `integrations-all` and `fleet-agent-policies-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 · default: false) — optional
- `packages` (object[] · min items: 1 · max items: 1000) — required
  - `name` (string) — 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

Bulk upgrade task initiated

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

#### Generic error response

Example of a generic error response

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

