---
type: api
title: Export stream content
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-post-streams-name-content-export
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-post-streams-name-content-export
products:
  - Kibana
---

# Export stream content

Availability: Experimental since 9.1

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

## Paths

- `POST` `/api/streams/{name}/content/export`
- `POST` `/s/{space_id}/api/streams/{name}/content/export`

#### Path parameters

- `name` (string · max length: 200) — required
  The name of the stream to export content from.

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Exports a content pack with the stream structure (routing, mappings, and processing). Significant-event queries are not included; manage them via the /api/streams/{name}/queries endpoints.

## Required authorization

- Privileges: `manage_stream`

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

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `description` (string · max length: 1000) — required
- `include` (union anyOf) — required
  - **object**
    - `objects` (object) — required
      - `all` (object) — required
  - **object**
    - `objects` (object) — required
      - `mappings` (boolean) — required
      - `routing` (union anyOf[] · max items: 200) — required
        - `destination` (string · min length: 1 · max length: 200) — required
- `name` (string · max length: 256) — required
- `version` (string · max length: 100) — required

## Response

Content pack archive for the stream.

## Code examples

#### Console

```console
POST kbn:/api/streams/NAME/content/export
{
  "description": "Nginx stream content pack",
  "include": {
    "objects": {
      "all": {}
    }
  },
  "name": "nginx-pack",
  "version": "1.0.0"
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/streams/${NAME}/content/export" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Nginx stream content pack",
    "include": {
      "objects": {
        "all": {}
      }
    },
    "name": "nginx-pack",
    "version": "1.0.0"
  }'
```

