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

# Export an exception list

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

## Paths

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

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

Export an exception list and its associated items to an NDJSON file.

## Query String Parameters

- `id` (string · min: 1)
  Exception list's identifier
- `list_id` (string · min: 1)
  Exception list's human identifier
- `namespace_type` (enum)
  Values: `agnostic`, `single`
- `include_expired_exceptions` (enum  · default: true)
  Determines whether to include expired exceptions in the exported list
  Values: `true`, `false`

## Responses

#### `200`

Successful response

`application/ndjson`

Type: `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)
#### `404`

Exception list not found 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/_export?id={id}&list_id={list_id}&namespace_type={namespace_type}&include_expired_exceptions={include_expired_exceptions}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/exception_lists/_export?id={id}&list_id={list_id}&namespace_type={namespace_type}&include_expired_exceptions={include_expired_exceptions}"
```

