---
type: api
title: Fork a stream
description: Forks a wired stream and creates a child stream<br/><br/>[Required authorization] Route required privileges: manage_stream.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-streams-name-fork
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-streams-name-fork
products:
  - Kibana
---

# Fork a stream

Availability: 9.1+

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

## Paths

- `POST` `/api/streams/{name}/_fork`

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

#### Path Parameters

- `name` (string · max: 200)
  The name of the parent stream to fork from.

## Description

Forks a wired stream and creates a child stream<br/><br/>[Required authorization] Route required privileges: manage_stream.

## Request Body

`application/json`

- `draft` (boolean) — optional
- `status` (enum) — optional
  Values: `enabled`, `disabled`
- `stream` (object) — required
  - `name` (string · max: 200) — required
- `where` (union anyOf) — required
  - **{ contains, endsWith, eq, … }**
    - `contains` (union string | number | boolean) — optional
    - `endsWith` (union string | number | boolean) — optional
    - `eq` (union string | number | boolean) — optional
    - `field` (string · min: 1 · max: 256) — required
    - `gt` (union string | number | boolean) — optional
    - `gte` (union string | number | boolean) — optional
    - `includes` (union string | number | boolean) — optional
    - `lt` (union string | number | boolean) — optional
    - `lte` (union string | number | boolean) — optional
    - `neq` (union string | number | boolean) — optional
    - `range` (object) — optional
      - `gt` (union string | number | boolean) — optional
      - `gte` (union string | number | boolean) — optional
      - `lt` (union string | number | boolean) — optional
      - `lte` (union string | number | boolean) — optional
    - `startsWith` (union string | number | boolean) — optional
  - **{ exists }**
    - `exists` (boolean) — optional
    - `field` (string · min: 1 · max: 256) — required
  - **{ and }**
    - `and` ([] union anyOf · max: 50) — required — recursive
      Same options as `where`
  - **{ or }**
    - `or` ([] union anyOf · max: 50) — required — recursive
      Same options as `where`
  - **{ not }**
    - `not` (union anyOf) — required — recursive
      Same options as `where`
  - **{ always }**
    - `always` (object) — required
  - **{ never }**
    - `never` (object) — required

## Response

The stream was forked successfully.

## Code Examples

#### Console

```console
POST /api/streams/{name}/_fork
{
  "status": "enabled",
  "stream": {
    "name": "logs.nginx.errors"
  },
  "where": {
    "eq": "500",
    "field": "http.response.status_code"
  }
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/streams/{name}/_fork" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "enabled",
  "stream": {
    "name": "logs.nginx.errors"
  },
  "where": {
    "eq": "500",
    "field": "http.response.status_code"
  }
}'
```

