---
title: "Dry run a package policy upgrade"
method: POST
path: "/api/fleet/package_policies/upgrade/dryrun"
tags: ["Fleet package policies"]
---

# Dry run a package policy upgrade

`POST /api/fleet/package_policies/upgrade/dryrun`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/package_policies/upgrade/dryrun</span></div>

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

Preview the changes that would be applied by upgrading a package policy to a newer package version.<br/><br/>[Required authorization] Route required privileges: fleet-agent-policies-read AND integrations-read.

## Headers

- `kbn-xsrf` string, required

## Request body

- KibanaHTTPAPIsDryRunPackagePoliciesRequest
  - `packagePolicyIds` string[], required
  - `packageVersion` string

## Response `200`

Successful response

- object[]
  - `agent_diff` array[]
    - object[]
      - `data_stream` object, required
        - `namespace` string, required
      - `id` string, required
      - `meta` object
        - `package` object, required
          - `name` string, required
          - `version` string, required
      - `name` string, required
      - `package_policy_id` string, required
      - `processors` object[]
        - `add_fields` object, required
          - `fields` object, required
          - `target` string, required
      - `revision` number, required
      - `streams` object[]
        - `data_stream` object, required
          - `dataset` string, required
          - `type` string
        - `id` string
      - `type` string, required
      - `use_output` string, required
  - `body` object
    - `message` string, required
  - `diff` union[]
    - union
      - KibanaHTTPAPIsDryRunPackagePolicyResponse
        - `additional_datastreams_permissions` string[], nullable — Additional data stream permissions that will be added to the agent policy.
        - `agents` number
        - `cloud_connector_id` string, nullable — ID of the cloud connector associated with this package policy.
        - `cloud_connector_name` string, nullable — Transient field for cloud connector name during creation.
        - `condition` string, nullable — Agent condition expression to evaluate whether to apply this integration to its inputs.
        - `created_at` string, required
        - `created_by` string, required
        - `description` string — Package policy description
        - `elasticsearch` object
          - `privileges` object
            - `cluster` string[]
        - `enabled` boolean, required
        - `global_data_tags` object[], nullable
          - `name` string, required — The name of the custom field. Cannot contain spaces.
          - `value` union, required — The value of the custom field.
            - string
            - number
        - `id` string
        - `inputs` union, required — Package policy inputs.
          - object[]
            - `compiled_input` unknown, required
            - `condition` string, nullable — Agent condition expression to evaluate whether to apply this input.
            - `config` object — Package variable (see integration documentation for more information)
            - `deprecated` KibanaHTTPAPIsPackagePolicyInputDeprecationInfo
              - …
            - `enabled` boolean, required
            - `id` string
            - `keep_enabled` boolean
            - `migrate_from` string
            - `name` string
            - `policy_template` string
            - `streams` object[], required
              - …
            - `type` string, required
            - `var_group_selections` object — Variable group selections. Maps var_group name to the selected option name within that group.
            - `vars` object — Package variable (see integration documentation for more information)
          - object — Package policy inputs. Refer to the integration documentation to know which inputs are available.
        - `is_managed` boolean
        - `name` string, required — Unique name for the package policy.
        - `namespace` string — The package policy namespace. Leave blank to inherit the agent policy's namespace.
        - `output_id` string, nullable
        - `overrides` object, nullable — Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure.
          - `inputs` object
        - `package` KibanaHTTPAPIsPackagePolicyPackage
          - `experimental_data_stream_features` object[]
            - `data_stream` string, required
            - `features` object, required
              - …
          - `fips_compatible` boolean
          - `name` string, required — Package name
          - `requires_root` boolean
          - `title` string
          - `version` string, required — Package version
        - `package_agent_version_condition` string
        - `policy_id` string, nullable — ID of the agent policy which the package policy will be added to.
        - `policy_ids` string[]
        - `revision` number, required — Package policy revision.
        - `secret_references` object[]
          - `id` string, required
        - `spaceIds` string[]
        - `supports_agentless` boolean, nullable — Indicates whether the package policy belongs to an agentless agent policy.
        - `supports_cloud_connector` boolean, nullable — Indicates whether the package policy supports cloud connectors.
        - `updated_at` string, required
        - `updated_by` string, required
        - `var_group_selections` object — Variable group selections. Maps var_group name to the selected option name within that group.
        - `vars` union — Package level variable.
          - object — Package variable (see integration documentation for more information)
          - object — Input/stream level variable. Refer to the integration documentation for more information.
        - `version` string — Package policy ES version.
      - KibanaHTTPAPIsDryRunPackagePolicy
        - `additional_datastreams_permissions` string[], nullable — Additional data stream permissions that will be added to the agent policy.
        - `cloud_connector_id` string, nullable — ID of the cloud connector associated with this package policy.
        - `cloud_connector_name` string, nullable — Transient field for cloud connector name during creation.
        - `condition` string, nullable — Agent condition expression to evaluate whether to apply this integration to its inputs.
        - `created_at` string
        - `created_by` string
        - `description` string — Package policy description
        - `elasticsearch` object
          - `privileges` object
            - `cluster` string[]
        - `enabled` boolean, required
        - `errors` object[]
          - `key` string
          - `message` string, required
        - `force` boolean
        - `global_data_tags` object[], nullable
          - `name` string, required — The name of the custom field. Cannot contain spaces.
          - `value` union, required — The value of the custom field.
            - string
            - number
        - `id` string
        - `inputs` object[], required
          - `compiled_input` unknown, required
          - `condition` string, nullable — Agent condition expression to evaluate whether to apply this input.
          - `config` object — Package variable (see integration documentation for more information)
          - `deprecated` KibanaHTTPAPIsPackagePolicyInputDeprecationInfo
            - `description` string, required
            - `replaced_by` object
            - `since` string
          - `enabled` boolean, required
          - `id` string
          - `keep_enabled` boolean
          - `migrate_from` string
          - `name` string
          - `policy_template` string
          - `streams` object[], required
            - `compiled_stream` unknown, required
            - `condition` string, nullable — Agent condition expression to evaluate whether to apply this stream.
            - `config` object — Package variable (see integration documentation for more information)
            - `data_stream` object, required
              - …
            - `deprecated` KibanaHTTPAPIsPackagePolicyStreamDeprecationInfo
              - …
            - `enabled` boolean, required
            - `id` string
            - `keep_enabled` boolean
            - `migrate_from` string
            - `release` 'ga' | 'beta' | 'experimental'
            - `var_group_selections` object — Variable group selections. Maps var_group name to the selected option name within that group.
            - `vars` object — Package variable (see integration documentation for more information)
          - `type` string, required
          - `var_group_selections` object — Variable group selections. Maps var_group name to the selected option name within that group.
          - `vars` object — Package variable (see integration documentation for more information)
        - `is_managed` boolean
        - `missingVars` string[]
        - `name` string, required — Unique name for the package policy.
        - `namespace` string — The package policy namespace. Leave blank to inherit the agent policy's namespace.
        - `output_id` string, nullable
        - `overrides` object, nullable — Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure.
          - `inputs` object
        - `package` KibanaHTTPAPIsPackagePolicyPackage
          - `experimental_data_stream_features` object[]
            - `data_stream` string, required
            - `features` object, required
              - …
          - `fips_compatible` boolean
          - `name` string, required — Package name
          - `requires_root` boolean
          - `title` string
          - `version` string, required — Package version
        - `package_agent_version_condition` string
        - `policy_id` string, nullable — ID of the agent policy which the package policy will be added to.
        - `policy_ids` string[]
        - `revision` number
        - `secret_references` object[]
          - `id` string, required
        - `supports_agentless` boolean, nullable — Indicates whether the package policy belongs to an agentless agent policy.
        - `supports_cloud_connector` boolean, nullable — Indicates whether the package policy supports cloud connectors.
        - `updated_at` string
        - `updated_by` string
        - `var_group_selections` object — Variable group selections. Maps var_group name to the selected option name within that group.
        - `vars` object — Package variable (see integration documentation for more information)
        - `version` string — Package policy ES version.
  - `hasErrors` boolean, required
  - `name` string
  - `statusCode` number

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
