---
type: api
title: Deprecated: Bulk upgrade managed integrations
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-agentless-policies-upgrade
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-post-fleet-agentless-policies-upgrade
products:
  - Kibana
---

# Deprecated: Bulk upgrade managed integrations

Availability: 9.5+

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

## Paths

- `POST` `/api/fleet/agentless_policies/_upgrade`
- `POST` `/s/{space_id}/api/fleet/agentless_policies/_upgrade`

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

Deprecated. Use `POST /api/fleet/managed_integrations/_upgrade` instead. Upgrade multiple managed integrations to their installed package version, migrating each package policy's config onto the new schema. Always returns 200 with a per-policy result array; a missing id, or an id that is not a managed integration, is reported as a per-item failure (`success: false` + `statusCode`) without failing the batch, so valid ids are still upgraded. A successful result means the policy's saved object was upgraded, while the agentless deployment is reconciled asynchronously in the background. Policies already at the installed version are a genuine no-op: they still report `success: true` (calls stay idempotent) but nothing is re-persisted or redeployed. Note: agent-policy-level agentless settings (resources, ownership tags) are not re-derived from the new package version — use the update (PUT) endpoint for those.

## Request Body

`application/json`

- `policyIds` ([] string · max: 1000) — required
  IDs of the managed integrations to upgrade to their installed package version.

## Responses

#### `200`

Indicates a successful response. Each item reports the per-policy upgrade outcome; inspect every item's `success` flag. A missing id, or an id that is not a managed integration, is reported as a per-item failure (`success: false` + `statusCode`) without failing the batch.

`application/json`

Type: `[] object · max: 10000`

- `body` (object)
  - `message` (string · max: 4096)
    Error message when the upgrade failed for this policy.
- `id` (string · max: 256)
  The ID of the managed integration.
- `name` (string · max: 256)
  The name of the managed integration.
- `statusCode` (number)
  HTTP-like status code when the upgrade failed for this policy.
- `success` (boolean)
  Whether the policy's saved object was upgraded successfully. The live workload is reconciled asynchronously in the background.
#### `400`

Bad Request

`application/json`

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

#### Console

```console
POST /api/fleet/agentless_policies/_upgrade
{
  "policyIds": [
    "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "aws-policy-12345"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/agentless_policies/_upgrade" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "policyIds": [
    "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "aws-policy-12345"
  ]
}'
```

## Response Examples

#### Upgrade managed integrations partial failure response

Example response where one managed integration upgraded and another id was missing or not a managed integration (the batch still returns 200)

```json
[
  {
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "name": "ess_billing-1",
    "success": true
  },
  {
    "body": {
      "message": "Agentless policy aws-policy-12345 not found"
    },
    "id": "aws-policy-12345",
    "statusCode": 404,
    "success": false
  }
]
```

#### Upgrade managed integrations response

Example response where every policy was upgraded

```json
[
  {
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "name": "ess_billing-1",
    "success": true
  },
  {
    "id": "aws-policy-12345",
    "name": "cspm-aws-policy",
    "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
}
```

