---
type: api
title: Create a shared exception list
description: An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-createsharedexceptionlist
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-createsharedexceptionlist
products:
  - Kibana
---

# Create a shared exception list

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

## Paths

- `POST` `/api/exceptions/shared`

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

## Description

An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules.
> info
> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item.

## Request Body

`application/json`

- `description` (string) — required
  Describes the exception list.
- `name` (string) — required
  The name of the exception list.

## Responses

#### `200`

Successful response

`application/json`

- `_version` (string)
  The version id, normally returned by the API when the item was retrieved. Use it ensure updates are done against the latest version.
- `created_at` (string)
  Autogenerated date of object creation.
- `created_by` (string)
  Autogenerated value - user that created object.
- `description` (string)
  Describes the exception list.
- `id` (string · min: 1)
  Exception list's identifier.
- `immutable` (boolean)
- `list_id` (string · min: 1)
  The exception list's human-readable string identifier.

For endpoint artifacts, use one of the following values:

* `endpoint_list`: Elastic Endpoint exceptions list
* `endpoint_trusted_apps`: Trusted applications list
* `endpoint_trusted_devices`: Trusted devices list
* `endpoint_event_filters`: Event filters list
* `endpoint_host_isolation_exceptions`: Host isolation exceptions list
* `endpoint_blocklists`: Blocklist
- `meta` (object)
  Placeholder for metadata about the list container.
- `name` (string)
  The name of the exception list.
- `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.

For endpoint artifacts, the `namespace_type` must always be `agnostic`. Space awareness for endpoint artifacts is enforced based on Elastic Defend policy assignments.
  Values: `agnostic`, `single`
- `os_types` ([] object)
  Use this field to specify the operating system. Only enter one value.
  Values: `linux`, `macos`, `windows`
- `tags` ([] object)
  String array containing words and phrases to help categorize exception containers.
- `tie_breaker_id` (string)
  Field used in search to ensure all containers are sorted and returned correctly.
- `type` (enum)
  The type of exception list to be created. Different list types may denote where they can be utilized.
  Values: `detection`, `rule_default`, `endpoint`, `endpoint_trusted_apps`, `endpoint_trusted_devices`, `endpoint_events`, `endpoint_host_isolation_exceptions`, `endpoint_blocklists`, `endpoint_custom_yara_signatures`
- `updated_at` (string)
  Autogenerated date of last object update.
- `updated_by` (string)
  Autogenerated value - user that last updated object.
- `version` (integer · min: 1)
  The document version, automatically increasd on updates.
#### `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 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/exceptions/shared
{
  "description": "This is a sample detection type exception list.",
  "list_id": "simple_list",
  "name": "Sample Detection Exception List",
  "namespace_type": "single",
  "os_types": [
    "linux"
  ],
  "tags": [
    "malware"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/exceptions/shared" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "This is a sample detection type exception list.",
  "list_id": "simple_list",
  "name": "Sample Detection Exception List",
  "namespace_type": "single",
  "os_types": [
    "linux"
  ],
  "tags": [
    "malware"
  ]
}'
```

## Response Examples

#### Shared list

```json
{
  "_version": "WzIsMV0=",
  "created_at": "2025-01-07T19:34:27.942Z",
  "created_by": "elastic",
  "description": "This is a sample detection type exception list.",
  "id": "9e5fc75a-a3da-46c5-96e3-a2ec59c6bb85",
  "immutable": false,
  "list_id": "simple_list",
  "name": "Sample Detection Exception List",
  "namespace_type": "single",
  "os_types": [
    "linux"
  ],
  "tags": [
    "malware"
  ],
  "tie_breaker_id": "78f1aca1-f8ee-4eb5-9ceb-f5c3ee656cb3",
  "type": "detection",
  "updated_at": "2025-01-07T19:34:27.942Z",
  "updated_by": "elastic",
  "version": 1
}
```

#### Bad

```json
{
  "error": "Bad Request",
  "message": "[request body]: list_id: Expected string, received number",
  "statusCode": 400
}
```

#### Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
```

#### Forbidden

```json
{
  "message": "Unable to create exception-list",
  "status_code": 403
}
```

#### Already exists

```json
{
  "message": "exception list id: \u0022simple_list\u0022 already exists",
  "status_code": 409
}
```

#### Server error

```json
{
  "message": "Internal Server Error",
  "status_code": 500
}
```

