---
type: api
title: Create rule exception list items
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-createruleexceptionlistitems
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-createruleexceptionlistitems
products:
  - Kibana
---

# Create rule exception list items

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

## Paths

- `POST` `/api/detection_engine/rules/{id}/exceptions`
- `POST` `/s/{space_id}/api/detection_engine/rules/{id}/exceptions`

- [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)

#### Path Parameters

- `id` (string)
  Detection rule's identifier

## Description

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

Create exception items that apply to a single detection rule.

## Request Body

`application/json`

Rule exception list items

- `items` ([] object) — required
  - `comments` ([] object) — optional
    - `comment` (string · min: 1) — required
      A string that does not contain only whitespace characters
  - `description` (string) — required
  - `entries` ([] object) — required
  - `expire_time` (string) — optional
  - `item_id` (string · min: 1) — optional
    A string that does not contain only whitespace characters
  - `meta` (object) — optional
  - `name` (string · min: 1) — required
    A string that does not contain only whitespace characters
  - `namespace_type` (enum) — optional
    Determines whether the exception container is available in all Kibana spaces or just the space
in which it is created, where:

- `single`: Only available in the Kibana space in which it is created.
- `agnostic`: Available in all Kibana spaces.
    Values: `agnostic`, `single`
  - `os_types` ([] object) — optional
    Values: `linux`, `macos`, `windows`
  - `tags` ([] object) — optional
  - `type` (enum) — required
    Values: `simple`

## Responses

#### `200`

Successful response

`application/json`

Type: `[] object`

- `_version` (string)
- `comments` ([] object)
  - `comment` (string · min: 1)
    A string that does not contain only whitespace characters
  - `created_at` (string)
  - `created_by` (string · min: 1)
    A string that does not contain only whitespace characters
  - `id` (string · min: 1)
    A string that does not contain only whitespace characters
  - `updated_at` (string)
  - `updated_by` (string · min: 1)
    A string that does not contain only whitespace characters
- `created_at` (string)
- `created_by` (string)
- `description` (string)
- `entries` ([] object)
- `expire_time` (string)
- `id` (string · min: 1)
  A string that does not contain only whitespace characters
- `item_id` (string · min: 1)
  A string that does not contain only whitespace characters
- `list_id` (string · min: 1)
  A string that does not contain only whitespace characters
- `meta` (object)
- `name` (string · min: 1)
  A string that does not contain only whitespace characters
- `namespace_type` (enum)
  Determines whether the exception container is available in all Kibana spaces or just the space
in which it is created, where:

- `single`: Only available in the Kibana space in which it is created.
- `agnostic`: Available in all Kibana spaces.
  Values: `agnostic`, `single`
- `os_types` ([] object)
  Values: `linux`, `macos`, `windows`
- `tags` ([] object)
- `tie_breaker_id` (string)
- `type` (enum)
  Values: `simple`
- `updated_at` (string)
- `updated_by` (string)
#### `400`

Invalid input data response

`application/json`

One of:
- **PlatformErrorResponse**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **SiemErrorResponse**
  - `message` (string)
  - `status_code` (integer)
#### `401`

Unsuccessful authentication response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `403`

Not enough privileges response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `500`

Internal server error response

`application/json`

- `message` (string)
- `status_code` (integer)
## Code Examples

#### Console

```console
POST /api/detection_engine/rules/{id}/exceptions
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/detection_engine/rules/{id}/exceptions"
```

