---
type: api
title: Promote a data stream
description: Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-indices-promote-data-stream
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-indices-promote-data-stream
products:
  - Elasticsearch
---

# Promote a data stream

Availability: 7.9+

## Paths

- `POST` `/_data_stream/_promote/{name}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `name` (string IndexName)
  The name of the data stream to promote

## Description

Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.

With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster.
These data streams can't be rolled over in the local cluster.
These replicated data streams roll over only if the upstream data stream rolls over.
In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.

NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.
If this is missing, the data stream will not be able to roll over until a matching index template is created.
This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

## Response

`application/json`

Type: `object`

## Code Examples

#### Console

```console
POST /_data_stream/_promote/my-data-stream
```

#### JavaScript

```javascript
const response = await client.indices.promoteDataStream({
  name: "my-data-stream",
});
```

#### Python

```python
resp = client.indices.promote_data_stream(
    name="my-data-stream",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_data_stream/_promote/my-data-stream" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.indices().promoteDataStream(p -> p
    .name("my-data-stream")
);
```

#### C#

```c#
var response = await client.Indices.PromoteDataStreamAsync(name: "my-data-stream");
```

#### PHP

```php
$resp = $client->indices()->promoteDataStream([
    "name" => "my-data-stream",
]);
```

#### Ruby

```ruby
response = client.indices.promote_data_stream(
  name: "my-data-stream"
)
```

