---
type: api
title: Install a package from the registry
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-post-fleet-epm-packages-pkgname-pkgversion
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-post-fleet-epm-packages-pkgname-pkgversion
products:
  - Kibana
---

# Install a package from the registry

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

## Paths

- `POST` `/api/fleet/epm/packages/{pkgName}/{pkgVersion}`
- `POST` `/api/fleet/epm/packages/{pkgName}`
- `POST` `/s/{space_id}/api/fleet/epm/packages/{pkgName}/{pkgVersion}`

#### Path parameters

- `pkgName` (string) — required
  Package name
- `pkgVersion` (string) — optional, leave it out to use `/api/fleet/epm/packages/{pkgName}`
  Package version

## Description

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

Install a specific version of a package from the Elastic Package Registry.

## Required authorization

- Privileges: `integrations-all` and `fleet-agent-policies-all`

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `prerelease` (boolean) — optional
  When true, allow installing prerelease versions
- `ignoreMappingUpdateErrors` (boolean · default: false) — optional
  When true, ignore mapping update errors during installation
- `skipDataStreamRollover` (boolean · default: false) — optional
  When true, skip data stream rollover after installation
- `skipDependencyCheck` (boolean · default: false) — optional
  Skip dependency validation when installing a package with dependencies

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `force` (boolean · default: false) — optional
- `ignore_constraints` (boolean · default: false) — optional

## Responses

#### `200`

Successful response

`application/json`

- `_meta` (object)
  - `install_source` (string)
  - `name` (string)
- `items` (union anyOf[] · max items: 10000)
  - **kibana_asset_reference**
    - `deferred` (boolean)
    - `id` (string)
    - `originId` (string)
    - `type` (union enum | string)
      Values: `dashboard`, `lens`, `visualization`, `search`, `index-pattern`, `map`, `ml-module`, `security-rule`, `csp-rule-template`, `osquery-pack-asset`, `osquery-saved-query`, `tag`
  - **es_asset_reference**
    - `customDataStreamOriginDataset` (string)
    - `customDataStreamOriginType` (string)
    - `deferred` (boolean)
    - `id` (string)
    - `type` (enum)
      Values: `index`, `index_template`, `component_template`, `ingest_pipeline`, `ilm_policy`, `data_stream_ilm_policy`, `transform`, `ml_model`, `knowledge_base`, `esql_view`
    - `version` (string)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
POST kbn:/api/fleet/epm/packages/PKG_NAME/PKG_VERSION
{
  "ignore_constraints": false
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/epm/packages/${PKG_NAME}/${PKG_VERSION}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "ignore_constraints": false
  }'
```

## Response examples

#### Post install package

Package successfully installed

```json
{
  "_meta": {
    "install_source": "registry"
  },
  "items": [
    {
      "id": "aws-logs-aws.cloudwatch_logs-default",
      "type": "index_template"
    }
  ]
}
```

#### Generic error response

Example of a generic error response

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

