---
type: api
title: Unfollow an index
description: Convert a cross-cluster replication follower index to a regular index.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ccr-unfollow
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ccr-unfollow
products:
  - Elasticsearch
---

# Unfollow an index

Availability: 6.5+

## Paths

- `POST` `/{index}/_ccr/unfollow`

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

#### Path Parameters

- `index` (string IndexName)
  The name of the follower index.

## Description

Convert a cross-cluster replication follower index to a regular index.
The API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
The follower index must be paused and closed before you call the unfollow API.

> info
> Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.

## Required authorization

* Index privileges: `manage_follow_index`

[Read the reference documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/xpack-ccr.html)

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  The period to wait for a connection to the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
It can also be set to `-1` to indicate that the request should never timeout.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code Examples

#### Console

```console
POST /follower_index/_ccr/unfollow
```

#### JavaScript

```javascript
const response = await client.ccr.unfollow({
  index: "follower_index",
});
```

#### Python

```python
resp = client.ccr.unfollow(
    index="follower_index",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/follower_index/_ccr/unfollow" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ccr().unfollow(u -> u
    .index("follower_index")
);
```

#### C#

```c#
var response = await client.CrossClusterReplication.UnfollowAsync(index: "follower_index");
```

#### PHP

```php
$resp = $client->ccr()->unfollow([
    "index" => "follower_index",
]);
```

#### Ruby

```ruby
response = client.ccr.unfollow(
  index: "follower_index"
)
```

## Response Examples

#### Unfollow index response example1

A successful response from `POST /follower_index/_ccr/unfollow`.

```json
{
  "acknowledged" : true
}
```

