---
type: api
title: Bulk get package policies
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-package-policies-bulk-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-package-policies-bulk-get
products:
  - Kibana
---

# Bulk get package policies

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

## Paths

- `POST` `/api/fleet/package_policies/_bulk_get`
- `POST` `/s/{space_id}/api/fleet/package_policies/_bulk_get`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

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

Get multiple package policies by ID.

## Query String Parameters

- `format` (enum)
  Format for the response: simplified or legacy
  Values: `simplified`, `legacy`

## Request Body

`application/json`

- `ids` ([] string · max: 1000) — required
  list of package policy ids
- `ignoreMissing` (boolean) — optional

## Responses

#### `200`

Successful response

`application/json`

- `items` ([] object · max: 10000)
  - `additional_datastreams_permissions` ([] string · max: 1000) — 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 · min: 1 · max: 255) — nullable
    Transient field for cloud connector name during creation.
  - `condition` (string · max: 10000) — 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 · max: 100)
  - `enabled` (boolean)
  - `global_data_tags` ([] object · max: 100) — nullable
    - `name` (string)
      The name of the custom field. Cannot contain spaces.
    - `value` (number | string)
      The value of the custom field.
  - `id` (string)
    Package policy unique identifier.
  - `inputs` (union anyOf)
    Package policy inputs.
    - **[]object**
      - `compiled_input` (object)
      - `condition` (string · max: 10000) — nullable
        Agent condition expression to evaluate whether to apply this input.
      - `config` (map string to object)
        Package variable (see integration documentation for more information)
        Map values (object)
        - `frozen` (boolean)
        - `type` (string)
        - `value` (object)
      - `deprecated` ({})
        - `description` (string · max: 4096)
        - `replaced_by` (map string to string)
        - `since` (string · max: 50)
      - `enabled` (boolean)
      - `id` (string)
      - `keep_enabled` (boolean)
      - `migrate_from` (string)
      - `name` (string)
      - `policy_template` (string)
      - `streams` ([] object · max: 1000)
        - `compiled_stream` (object)
        - `condition` (string · max: 10000) — nullable
          Agent condition expression to evaluate whether to apply this stream.
        - `config` (map string to object)
          Package variable (see integration documentation for more information)
          Map values (object)
          - `frozen` (boolean)
          - `type` (string)
          - `value` (object)
        - `data_stream` (object)
          - `dataset` (string)
          - `elasticsearch` (object)
            - `dynamic_dataset` (boolean)
            - `dynamic_namespace` (boolean)
            - `privileges` (object)
              - `indices` ([] string · max: 100)
          - `type` (string)
        - `deprecated` ({})
          - `description` (string · max: 4096)
          - `replaced_by` (map string to string)
          - `since` (string · max: 50)
        - `enabled` (boolean)
        - `id` (string)
        - `keep_enabled` (boolean)
        - `migrate_from` (string)
        - `release` (enum)
          Values: `ga`, `beta`, `experimental`
        - `var_group_selections` (map string to string)
          Variable group selections. Maps var_group name to the selected option name within that group.
        - `vars` (map string to object)
          Package variable (see integration documentation for more information)
          Map values (object)
          - `frozen` (boolean)
          - `type` (string)
          - `value` (object)
      - `type` (string)
      - `var_group_selections` (map string to string)
        Variable group selections. Maps var_group name to the selected option name within that group.
      - `vars` (map string to object)
        Package variable (see integration documentation for more information)
        Map values (object)
        - `frozen` (boolean)
        - `type` (string)
        - `value` (object)
    - **string to object**
      Package policy inputs. Refer to the integration documentation to know which inputs are available.
      - `<string>` (object)
        - `condition` (string · max: 10000) — nullable
          Agent condition expression to evaluate whether to apply this input.
        - `deprecated` ({})
          - `description` (string · max: 4096)
          - `replaced_by` (map string to string)
          - `since` (string · max: 50)
        - `enabled` (boolean)
          Enable or disable that input. Defaults to `true` (enabled).
        - `streams` (map string to object)
          Input streams. Refer to the integration documentation to know which streams are available.
          Map values (object)
          - `condition` (string · max: 10000) — nullable
            Agent condition expression to evaluate whether to apply this stream.
          - `deprecated` ({})
            - `description` (string · max: 4096)
            - `replaced_by` (map string to string)
            - `since` (string · max: 50)
          - `enabled` (boolean)
            Enable or disable that stream. Defaults to `true` (enabled).
          - `var_group_selections` (map string to string)
            Variable group selections. Maps var_group name to the selected option name within that group.
          - `vars` (map string to anyOf)
            Input/stream level variable. Refer to the integration documentation for more information.
        - `vars` (map string to anyOf)
          Input/stream level variable. Refer to the integration documentation for more information.
  - `is_managed` (boolean)
  - `name` (string)
    Unique name for the package policy.
  - `namespace` (string · max: 100)
    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` (map string to object)
  - `package` ({})
    - `experimental_data_stream_features` ([] object · max: 100)
      - `data_stream` (string · max: 1024)
      - `features` (object)
        - `doc_value_only_numeric` (boolean)
        - `doc_value_only_other` (boolean)
        - `synthetic_source` (boolean)
        - `tsdb` (boolean)
    - `fips_compatible` (boolean)
    - `name` (string · max: 255)
      Package name
    - `requires_root` (boolean)
    - `title` (string · max: 255)
    - `version` (string · max: 50)
      Package version
  - `package_agent_version_condition` (string)
  - `policy_id` (string) — nullable — deprecated
    ID of the agent policy which the package policy will be added to.
  - `policy_ids` ([] string · max: 1000)
  - `revision` (number)
    Package policy revision.
  - `secret_references` ([] object · max: 1000)
    - `id` (string)
  - `spaceIds` ([] string · max: 100)
  - `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` (map string to string)
    Variable group selections. Maps var_group name to the selected option name within that group.
  - `vars` (union anyOf)
    Package level variable.
    - **string to object**
      Package variable (see integration documentation for more information)
      - `<string>` (object)
        - `frozen` (boolean)
        - `type` (string)
        - `value` (object)
    - **string to anyOf**
      Input/stream level variable. Refer to the integration documentation for more information.
  - `version` (string)
    Package policy ES version.
#### `400`

Bad Request

`application/json`

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

Not Found

`application/json`

- `message` (string)
## Code Examples

#### Console

```console
POST /api/fleet/package_policies/_bulk_get
{
  "ids": [
    "package-policy-id-1",
    "package-policy-id-2"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/package_policies/_bulk_get" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "package-policy-id-1",
    "package-policy-id-2"
  ]
}'
```

## Response Examples

#### Post bulk get package policies

The requested package policies

```json
{
  "items": [
    {
      "created_at": "2024-01-15T10:00:00.000Z",
      "enabled": true,
      "id": "package-policy-id-1",
      "inputs": [],
      "name": "nginx-1",
      "namespace": "default",
      "package": {
        "name": "nginx",
        "title": "Nginx",
        "version": "1.20.0"
      },
      "policy_ids": [
        "agent-policy-id-1"
      ],
      "updated_at": "2024-01-15T10:00:00.000Z"
    }
  ]
}
```

#### Generic error response

Example of a generic error response

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

#### Not found

One or more package policies were not found

```json
{
  "error": "Not Found",
  "message": "Package policy package-policy-id-2 not found",
  "statusCode": 404
}
```

