Preview a managed integrations upgrade Experimental; added in 9.5.0

POST /api/fleet/managed_integrations/_upgrade/dryrun

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/managed_integrations/_upgrade/dryrun

Refer to Spaces for more information.

Preview upgrading multiple managed integrations without applying any change. Targets the installed package version by default; pass pkgVersion to preview a specific (for example, not-yet-installed) version. Each result returns the current/proposed version and any migration errors, plus — only on a clean dry-run (hasErrors: false) — the migrated proposedPolicy. proposedPolicy is for the edit-and-upgrade flow (edit it, then save via the update (PUT) endpoint); to apply an upgrade as-is, use _upgrade.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • pkgVersion string

    Target package version to preview the upgrade against. Defaults to the installed package version.

    Maximum length is 256.

  • policyIds array[string] Required

    IDs of the managed integrations to preview upgrading.

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

Responses

  • 200 application/json

    Indicates a successful response. Each clean item (hasErrors: false) previews the migrated policy as a consumable managed integration (proposedPolicy); a missing id, an id that is not a managed integration, or a migration error, is reported as a per-item failure (hasErrors: true, with proposedPolicy omitted) without failing the batch. Inspect every item.

    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 dry-run failed for this policy.

        Maximum length is 4096.

    • currentVersion string

      The current installed package version of the policy.

      Maximum length is 256.

    • errors array[object]

      Migration errors encountered while computing the upgrade.

      Not more than 1000 elements.

      Hide errors attribute Show errors attribute object
      • message string Required

        Human-readable migration error.

        Maximum length is 4096.

    • hasErrors boolean Required

      Whether the dry-run migration produced any errors.

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

    • proposedPolicy object

      Additional properties are NOT allowed.

      Hide proposedPolicy attributes Show proposedPolicy attributes object
      • additional_datastreams_permissions array[string]

        Additional data stream permissions granted to the managed integration.

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

      • cloud_connector object

        Additional properties are NOT allowed.

        Hide cloud_connector attributes Show cloud_connector attributes object
        • cloud_connector_id string Required

          The ID of the cloud connector.

          Maximum length is 255.

        • enabled boolean Required

          Whether the cloud connector is active for this policy.

      • created_at string Required

        Creation timestamp (ISO 8601).

        Maximum length is 64.

      • created_by string Required

        User who created the policy.

        Maximum length is 1024.

      • description string

        Managed integration description.

        Maximum length is 2048.

      • global_data_tags array[object]

        Custom data tags applied to all data produced by this policy.

        Not more than 100 elements.

        Hide global_data_tags attributes Show global_data_tags attributes object
        • name string Required

          The name of the custom field.

          Maximum length is 1024.

        • value string | number Required

          The value of the custom field.

          Any of:

          Maximum length is 1024.

      • id string Required

        Managed integration unique identifier.

        Maximum length is 255.

      • inputs object Required

        Package policy inputs. Refer to the integration documentation to know which inputs are available.

        Hide inputs attribute Show inputs attribute object
        • * object Additional properties

          Additional properties are NOT allowed.

          Hide * attributes Show * attributes object
          • condition string | null

            Agent condition expression to evaluate whether to apply this input.

            Maximum length is 10000.

          • deprecated object

            Additional properties are NOT allowed.

            Hide deprecated attributes Show deprecated attributes object
            • description string Required

              Maximum length is 4096.

            • replaced_by object
              Hide replaced_by attribute Show replaced_by attribute object
              • * string Additional properties

                Maximum length is 1024.

            • since string

              Maximum length is 50.

          • enabled boolean

            Enable or disable that input. Defaults to true (enabled).

          • streams object

            Input streams. Refer to the integration documentation to know which streams are available.

            Hide streams attribute Show streams attribute object
            • * object Additional properties

              Additional properties are NOT allowed.

              Hide * attributes Show * attributes object
              • condition string | null

                Agent condition expression to evaluate whether to apply this stream.

                Maximum length is 10000.

              • deprecated object

                Additional properties are NOT allowed.

                Hide deprecated attributes Show deprecated attributes object
                • description string Required

                  Maximum length is 4096.

                • replaced_by object
                  Hide replaced_by attribute Show replaced_by attribute object
                  • * string Additional properties

                    Maximum length is 1024.

                • since string

                  Maximum length is 50.

              • enabled boolean

                Enable or disable that stream. Defaults to true (enabled).

              • var_group_selections object

                Variable group selections. Maps var_group name to the selected option name within that group.

                Hide var_group_selections attribute Show var_group_selections attribute object
                • * string Additional properties

                  Maximum length is 1024.

              • vars object

                Input/stream level variable. Refer to the integration documentation for more information.

          • vars object

            Input/stream level variable. Refer to the integration documentation for more information.

      • name string Required

        Managed integration name.

        Maximum length is 255.

      • namespace string

        Policy namespace. Defaults to the agent policy namespace.

        Maximum length is 100.

      • package object Required

        Additional properties are NOT allowed.

        Hide package attributes Show package attributes object
        • name string Required

          Integration package name.

          Maximum length is 255.

        • title string Required

          Integration package display title.

          Maximum length is 255.

        • version string Required

          Integration package version.

          Maximum length is 50.

      • updated_at string Required

        Last update timestamp (ISO 8601).

        Maximum length is 64.

      • updated_by string Required

        User who last updated the policy.

        Maximum length is 1024.

      • var_group_selections object

        Variable group selections. Maps var_group name to the selected option name within that group.

        Hide var_group_selections attribute Show var_group_selections attribute object
        • * string Additional properties

          Maximum length is 1024.

      • vars object

        Input/stream level variable. Refer to the integration documentation for more information.

    • proposedVersion string

      The package version the policy would be upgraded to.

      Maximum length is 256.

    • statusCode number

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

  • 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/managed_integrations/_upgrade/dryrun
curl \
 --request POST 'https://localhost:5601/api/fleet/managed_integrations/_upgrade/dryrun' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '"{\n  \"policyIds\": [\n    \"d52a7812-5736-4fdc-aed8-72152afa1ffa\"\n  ]\n}"'
Request examples
Preview the upgrade of managed integrations to their installed package version
{
  "policyIds": [
    "d52a7812-5736-4fdc-aed8-72152afa1ffa"
  ]
}
Preview the upgrade against an explicit target package version (for example, before installing the new version). Defaults to the installed package version when omitted.
{
  "pkgVersion": "1.6.0",
  "policyIds": [
    "d52a7812-5736-4fdc-aed8-72152afa1ffa"
  ]
}
Response examples (200)
Example dry-run response where migrating the config to the new version produced errors. `hasErrors` is true and `errors` explains why; do not feed the (partial) proposed config into the update endpoint without resolving them.
[
  {
    "currentVersion": "1.5.0",
    "errors": [
      {
        "message": "Variable \"organization_id\" is required"
      }
    ],
    "hasErrors": true,
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "name": "ess_billing-1",
    "proposedVersion": "1.6.0"
  }
]
Example dry-run response for a mixed batch: one managed integration previews cleanly while two ids are missing or not managed integrations. Ids that are missing or not managed integrations are surfaced as per-item failures (`hasErrors: true` + `statusCode`) without failing the batch, and results stay in request order.
[
  {
    "currentVersion": "0.5.0",
    "hasErrors": false,
    "id": "2e426392-f856-4ab2-bc31-92d4dbb8d134",
    "name": "agentless_hello_world-16",
    "proposedPolicy": {
      "cloud_connector": null,
      "created_at": "2026-07-01T15:59:08.299Z",
      "created_by": "admin",
      "description": "",
      "id": "2e426392-f856-4ab2-bc31-92d4dbb8d134",
      "inputs": {
        "agentless_hello_world-cel": {
          "enabled": true,
          "streams": {
            "agentless_hello_world.generic": {
              "enabled": true,
              "vars": {
                "url": "https://epr.elastic.co"
              }
            },
            "agentless_hello_world.mock_counter": {
              "enabled": false,
              "vars": {
                "events_per_second": 10,
                "mode": "constant",
                "spike_events": 100,
                "spike_every_seconds": 60
              }
            }
          }
        },
        "agentless_hello_world-httpjson": {
          "enabled": false,
          "streams": {
            "agentless_hello_world.generic": {
              "enabled": false,
              "vars": {
                "url": "https://epr.elastic.co"
              }
            }
          }
        }
      },
      "name": "agentless_hello_world-16",
      "namespace": "default",
      "package": {
        "name": "agentless_hello_world",
        "title": "Agentless Hello World",
        "version": "0.5.0"
      },
      "updated_at": "2026-07-01T16:02:14.067Z",
      "updated_by": "admin"
    },
    "proposedVersion": "0.5.0"
  },
  {
    "body": {
      "message": "Agentless policy 9300464c-6cfc-4566-850d-e9e7927457fe not found"
    },
    "hasErrors": true,
    "id": "9300464c-6cfc-4566-850d-e9e7927457fe",
    "statusCode": 404
  },
  {
    "body": {
      "message": "Agentless policy 5b8763e9-791a-4038-be29-b384d578200e not found"
    },
    "hasErrors": true,
    "id": "5b8763e9-791a-4038-be29-b384d578200e",
    "statusCode": 404
  }
]
Example clean dry-run response (`hasErrors: false`) with the proposed (migrated) policy. `proposedPolicy` is intended for the edit-and-upgrade flow: edit it and submit the edited payload to the update (PUT) endpoint. To apply without edits, use the `_upgrade` endpoint instead.
[
  {
    "currentVersion": "1.5.0",
    "hasErrors": false,
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "name": "ess_billing-1",
    "proposedPolicy": {
      "created_at": "2025-11-06T18:27:43.541Z",
      "created_by": "test_user",
      "description": "test",
      "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
      "inputs": {
        "ESS Billing-cel": {
          "enabled": true,
          "vars": {
            "organization_id": "1234"
          }
        }
      },
      "name": "ess_billing-1",
      "namespace": "default",
      "package": {
        "name": "ess_billing",
        "title": "Elasticsearch Service Billing",
        "version": "1.6.0"
      },
      "updated_at": "2025-11-06T18:27:43.541Z",
      "updated_by": "test_user"
    },
    "proposedVersion": "1.6.0"
  }
]
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}