﻿---
title: stack kb security-exceptions-api export-exception-list cli command
description: Export an exception list Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4120/reference/elastic-cli/cli/stack/kb/security-exceptions-api/export-exception-list
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-exceptions-api export-exception-list cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-exceptions-api export-exception-list \
  --id <id> \
  --list-id <list-id> \
  --namespace-type <namespace-type> \
  --include-expired-exceptions <include-expired-exceptions> \
  [options]
```

Export an exception list
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--id string required">
    Exception list's internal `id` (UUID) returned on create; use with `list_id` and `namespace_type` for an unambiguous target.
  </definition>
  <definition term="--list-id string required">
    Human-readable `list_id` of the exception list to export, as shown in the UI and API responses.
  </definition>
  <definition term="--namespace-type enum required">
    `single` exports a list in the current Kibana space; `agnostic` exports a global (space-agnostic) list.
    **Values:** agnostic, single
  </definition>
  <definition term="--include-expired-exceptions enum required">
    Determines whether to include expired exceptions in the exported list. Expiration date defined by `expire_time`.
    **Values:** true, false
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>