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

# Create an exception list item

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

## Paths

- `POST` `/api/exception_lists/items`
- `POST` `/s/{space_id}/api/exception_lists/items`

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

Create an exception item and associate it with the specified exception list.
> info
> Before creating exception items, you must create an exception list.

## Request Body

`application/json`

Exception list item's properties

- `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
- `list_id` (string · min: 1) — required
  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`

- `_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)
#### `409`

Exception list item already exists response

`application/json`

- `message` (string)
- `status_code` (integer)
#### `500`

Internal server error response

`application/json`

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

#### Console

```console
POST /api/exception_lists/items
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/exception_lists/items"
```

