---
type: api
title: Install Kibana alert rule for a package
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-epm-packages-pkgname-pkgversion-rule-assets
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-epm-packages-pkgname-pkgversion-rule-assets
products:
  - Kibana
---

# Install Kibana alert rule for a package

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

## Paths

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

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

#### Path Parameters

- `pkgName` (string)
  Package name
- `pkgVersion` (string)
  Package version

## Description

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

Install Kibana alert rule assets for a specific package version.<br/><br/>[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.

## Request Body

`application/json`

- `force` (boolean) — optional

## Responses

#### `200`

Successful response

`application/json`

- `success` (boolean)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
POST /api/fleet/epm/packages/{pkgName}/{pkgVersion}/rule_assets
{}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/epm/packages/{pkgName}/{pkgVersion}/rule_assets" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Response Examples

#### Post install rule assets

Rule assets successfully installed

```json
{
  "items": [
    {
      "id": "rule-asset-id-1",
      "type": "security_rule"
    }
  ]
}
```

#### Generic error response

Example of a generic error response

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

