---
type: api
title: Export an exception list
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-exportexceptionlist
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/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`

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

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

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

## Responses

#### `200`

Successful response

`application/ndjson`

Type: `string · format: binary`

#### `400`

Invalid input data response

`application/json`

One of:
- **{ error, statusCode }**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **{ status_code }**
  - `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 kbn:/api/exception_lists/_export?id=ID&list_id=LIST_ID&namespace_type=agnostic&include_expired_exceptions=true
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/exception_lists/_export?id=${ID}&list_id=${LIST_ID}&namespace_type=agnostic&include_expired_exceptions=true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

