Deprecated: Bulk upgrade managed integrations Experimental; added in 9.5.0

POST /api/fleet/agentless_policies/_upgrade

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/agentless_policies/_upgrade

Refer to 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.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • policyIds array[string] Required

    IDs of the managed integrations to upgrade to their installed package version.

    Not more than 1000 elements. Maximum length of each is 256.

Responses

  • 200 application/json

    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.

    Hide response attributes Show response attributes object
    • body object

      Additional properties are NOT allowed.

      Hide body attribute Show body attribute object
      • message string Required

        Error message when the upgrade failed for this policy.

        Maximum length is 4096.

    • id string Required

      The ID of the managed integration.

      Maximum length is 256.

    • name string

      The name of the managed integration.

      Maximum length is 256.

    • statusCode number

      HTTP-like status code when the upgrade failed for this policy.

    • success boolean Required

      Whether the policy's saved object was upgraded successfully. The live workload is reconciled asynchronously in the background.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/agentless_policies/_upgrade
curl \
 --request POST 'https://localhost:5601/api/fleet/agentless_policies/_upgrade' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '"{\n  \"policyIds\": [\n    \"d52a7812-5736-4fdc-aed8-72152afa1ffa\",\n    \"aws-policy-12345\"\n  ]\n}"'
Request example
Bulk upgrade managed integrations to their installed package version
{
  "policyIds": [
    "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "aws-policy-12345"
  ]
}
Response examples (200)
Example response where one managed integration upgraded and another id was missing or not a managed integration (the batch still returns 200)
[
  {
    "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
  }
]
Example response where every policy was upgraded
[
  {
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "name": "ess_billing-1",
    "success": true
  },
  {
    "id": "aws-policy-12345",
    "name": "cspm-aws-policy",
    "success": true
  }
]
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}