---
type: api
title: Update package policy by ID
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-update-package-policy
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-update-package-policy
products:
  - Kibana
---

# Update package policy by ID

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

## Paths

- `PUT` `/api/fleet/package_policies/{packagePolicyId}`
- `PUT` `/s/{space_id}/api/fleet/package_policies/{packagePolicyId}`

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

## Description

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

## Query String Parameters

- `format` (enum)
  Simplified or legacy format for package inputs
  Values: `simplified`, `legacy`

## Request Body

`application/json`

- `description` (string) — optional
  Package policy description
- `force` (boolean) — optional
  Force package policy creation even if package is not verified, or if the agent policy is managed.
- `id` (string) — optional
  Package policy unique identifier
- `inputs` (map string to object) — optional
  Package policy inputs (see integration documentation to know what inputs are available)
  Map values (object)
  - `enabled` (boolean) — optional
    enable or disable that input, (default to true)
  - `streams` (map string to object) — optional
    Input streams (see integration documentation to know what streams are available)
    Map values (object)
    - `enabled` (boolean) — optional
      enable or disable that stream, (default to true)
    - `vars` (object) — optional
      Stream level variable (see integration documentation for more information)
  - `vars` (object) — optional
    Input level variable (see integration documentation for more information)
- `name` (string) — required
  Package policy name (should be unique)
- `namespace` (string) — optional
  The package policy namespace. Leave blank to inherit the agent policy's namespace.
- `output_id` (string) — optional — nullable
  Output ID to send package data to
- `overrides` (object) — optional — 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) — optional
- `package` (object) — required
  - `name` (string) — required
    Package name
  - `version` (string) — required
    Package version
- `policy_id` (string) — optional — nullable — deprecated
  Agent policy ID where that package policy will be added
- `policy_ids` ([] string) — optional
  Agent policy IDs where that package policy will be added
- `vars` (object) — optional
  Package root level variable (see integration documentation for more information)

## Responses

#### `200`

OK

`application/json`

- `item` ({})
  - `id` (string)
  - `inputs` (union oneOf)
    One of: `object[]` or `object`
  - `revision` (number)
  - `description` (string)
  - `enabled` (boolean)
  - `name` (string)
  - `namespace` (string)
  - `output_id` (string)
  - `overrides` (object)
  - `package` (object)
    - `name` (string)
    - `requires_root` (boolean)
    - `title` (string)
    - `version` (string)
  - `policy_id` (string) — nullable — deprecated
  - `policy_ids` ([] string)
#### `400`

Generic Error

`application/json`

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

#### Console

```console
PUT /api/fleet/package_policies/{packagePolicyId}
```

#### curl

```curl
curl -X PUT "https://{kibana_url}/api/fleet/package_policies/{packagePolicyId}" \
  -H "kbn-xsrf: true"
```

