---
title: "Fork a stream"
method: POST
path: "/api/streams/{name}/_fork"
tags: ["streams"]
---

# Fork a stream

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

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/streams/{name}/_fork</span></div>

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

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

## Path parameters

- `name` string, required

## Headers

- `kbn-xsrf` string, required

## Request body

- object
  - `draft` boolean
  - `status` 'enabled' | 'disabled'
  - `stream` object, required
    - `name` string, required
  - `where` union, required — The root condition object. It can be a simple filter or a combination of other conditions.
    - union — A basic filter condition, either unary or binary.
      - object — A condition that compares a field to a value or range using an operator as the key.
        - `contains` union — Contains comparison value.
          - string
          - number
          - boolean
        - `endsWith` union — Ends-with comparison value.
          - string
          - number
          - boolean
        - `eq` union — Equality comparison value.
          - string
          - number
          - boolean
        - `field` string, required — The document field to filter on.
        - `gt` union — Greater-than comparison value.
          - string
          - number
          - boolean
        - `gte` union — Greater-than-or-equal comparison value.
          - string
          - number
          - boolean
        - `includes` union — Checks if multivalue field includes the value.
          - string
          - number
          - boolean
        - `lt` union — Less-than comparison value.
          - string
          - number
          - boolean
        - `lte` union — Less-than-or-equal comparison value.
          - string
          - number
          - boolean
        - `neq` union — Inequality comparison value.
          - string
          - number
          - boolean
        - `range` object — Range comparison values.
          - `gt` union — A value that can be a string, number, or boolean.
            - string
            - number
            - boolean
          - `gte` union — A value that can be a string, number, or boolean.
            - string
            - number
            - boolean
          - `lt` union — A value that can be a string, number, or boolean.
            - string
            - number
            - boolean
          - `lte` union — A value that can be a string, number, or boolean.
            - string
            - number
            - boolean
        - `startsWith` union — Starts-with comparison value.
          - string
          - number
          - boolean
      - object — A condition that checks for the existence or non-existence of a field.
        - `exists` boolean — Indicates whether the field exists or not.
        - `field` string, required — The document field to check.
    - object — A logical AND that groups multiple conditions.
      - `and` KibanaHTTPAPIsCondition[], required — An array of conditions. All sub-conditions must be true for this condition to be true.
    - object — A logical OR that groups multiple conditions.
      - `or` KibanaHTTPAPIsCondition[], required — An array of conditions. At least one sub-condition must be true for this condition to be true.
    - object — A logical NOT that negates a condition.
      - `not` KibanaHTTPAPIsCondition, required — recursive
    - object — A condition that always evaluates to false.
      - `never` object, required — An empty object. This condition never matches.
    - object — A condition that always evaluates to true. Useful for catch-all scenarios, but use with caution as partitions are ordered.
      - `always` object, required — An empty object. This condition always matches.

## Response `200`

The stream was forked successfully.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
