---
type: api
title: Get the status and progress of a specific reindex task
description: This API follows reindex tasks across node-shutdown relocations, so callers can
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-get-reindex
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-get-reindex
products:
  - Elasticsearch
---

# Get the status and progress of a specific reindex task

Availability: 9.5+

## Paths

- `GET` `/_reindex/{task_id}`

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

#### Path Parameters

- `task_id` (string TaskId)
  The ID of the reindex task to retrieve.

## Description

This API follows reindex tasks across node-shutdown relocations, so callers can
keep using the original task ID throughout the lifetime of the operation.
Returned task IDs and timings reflect the original task, not its relocated successor.
Relocated task IDs are also supported. They are followed transparently and return the task ID and timings of the original task.

When the task ID cannot be resolved, the API returns the response below with a 404 status code.
This response is used whether the ID is unknown, refers to a non-reindex task, refers to a sliced child subtask, or refers to a task whose node left the cluster with no stored result (e.g. a non-graceful shutdown).
```
{
  "error": {
    "type": "resource_not_found_exception",
    "reason": "Reindex operation [r1A2WoRbTwKZ516z6NEs5A:36619] not found"
  },
  "status": 404
}
```

## Query String Parameters

- `wait_for_completion` (boolean · default: false)
  If `true`, the request blocks until the reindex task completes, then returns the result.
- `timeout` (string Duration · default: 30s)
  The period to wait for the reindex task to complete when `wait_for_completion` is `true`.

## Response

`application/json`

- `completed` (boolean)
  Whether the reindex task has completed.
- `id` (string TaskId)
  The ID of the reindex task. The value is the ID assigned when the task was first created and remains stable across node-shutdown relocations.
- `description` (string)
  A sanitized description of the reindex operation (source and destination indices, and optionally remote host info).
- `start_time_in_millis` (EpochTimeUnitMillis)
  The time at which the reindex task started, in milliseconds since the Unix epoch.
- `start_time` (string)
  The time at which the reindex task started, as an ISO 8601 formatted string.
Only present when the request includes the `?human=true` query parameter.
- `running_time` (string Duration)
  The elapsed running time of the reindex task, in a human-readable format.
Only present when the request includes the `?human=true` query parameter.
- `running_time_in_nanos` (DurationValueUnitNanos)
  The elapsed running time of the reindex task, in nanoseconds.
- `cancelled` (boolean)
  Whether the reindex task has been cancelled.
- `status` ({} ReindexStatus)
  The current progress of the reindex operation.
  - `slice_id` (number)
    The slice ID
  - `batches` (number)
    The number of scroll responses pulled back by the reindex.
  - `created` (number)
    The number of documents that were successfully created.
  - `deleted` (number)
    The number of documents that were successfully deleted.
  - `noops` (number)
    The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.
  - `requests_per_second` (number)
    The number of requests per second effectively executed during the reindex.
  - `retries` ({} Retries)
    The number of retries attempted by reindex. `bulk` is the number of bulk actions retried and `search` is the number of search actions retried.
    - `bulk` (number)
      The number of bulk actions retried.
    - `search` (number)
      The number of search actions retried.
  - `throttled` (string Duration)
  - `throttled_millis` (DurationValueUnitMillis)
    Number of milliseconds the request slept to conform to `requests_per_second`.
  - `throttled_until` (string Duration)
  - `throttled_until_millis` (DurationValueUnitMillis)
    This field should always be equal to zero in a `_reindex` response.
It only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to `requests_per_second`.
  - `total` (number)
    The number of documents that were successfully processed.
  - `updated` (number)
    The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.
  - `version_conflicts` (number)
    The number of version conflicts that reindex hits.
  - `cancelled` (string)
    The reason for cancellation if the slice was canceled
- `error` ({} ErrorCause)
  The error that caused the reindex task to fail, if any.
  - `type` (string)
    The type of error
  - `reason` (union string) — nullable
    A human-readable explanation of the error, in English.
    One of: `string`
  - `stack_trace` (string)
    The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
  - `caused_by` ({} ErrorCause) — recursive
    Same fields as `error`
  - `root_cause` ([] ErrorCause) — recursive
    Same fields as `error`
  - `suppressed` ([] ErrorCause) — recursive
    Same fields as `error`
- `response` ({} ReindexTaskResult)
  The final result of the completed reindex operation, if the task has finished successfully.
  - `batches` (number)
    The number of scroll responses pulled back by the reindex.
  - `created` (number)
    The number of documents that were successfully created.
  - `deleted` (number)
    The number of documents that were successfully deleted.
  - `failures` ([] BulkIndexByScrollFailure)
    Any failures encountered during the reindex. If non-empty, the reindex ended because of these failures.
    - `cause` ({} ErrorCause)
      - `type` (string)
        The type of error
      - `reason` (union string) — nullable
        A human-readable explanation of the error, in English.
        One of: `string`
      - `stack_trace` (string)
        The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
      - `caused_by` ({} ErrorCause) — recursive
        Same fields as `cause` in `failures`
      - `root_cause` ([] ErrorCause) — recursive
        Same fields as `cause` in `failures`
      - `suppressed` ([] ErrorCause) — recursive
        Same fields as `cause` in `failures`
    - `id` (string Id)
    - `index` (string IndexName)
    - `status` (number)
  - `noops` (number)
    The number of documents that were ignored because the script returned a `noop` value for `ctx.op`.
  - `requests_per_second` (number)
    The number of requests per second effectively executed during the reindex.
  - `retries` ({} Retries)
    The number of retries attempted by reindex.
    - `bulk` (number)
      The number of bulk actions retried.
    - `search` (number)
      The number of search actions retried.
  - `throttled_millis` (DurationValueUnitMillis)
    Number of milliseconds the request slept to conform to `requests_per_second`.
  - `throttled_until_millis` (DurationValueUnitMillis)
    This field should always be equal to zero in a completed reindex result.
  - `timed_out` (boolean)
    Whether any of the requests executed during the reindex timed out.
  - `took` (DurationValueUnitMillis)
    The total milliseconds the entire operation took.
  - `total` (number)
    The number of documents that were successfully processed.
  - `updated` (number)
    The number of documents that were successfully updated.
  - `version_conflicts` (number)
    The number of version conflicts that occurred.
## Code Examples

#### Console

```console
GET _reindex/r1A2WoRbTwKZ516z6NEs5A:36619
```

#### JavaScript

```javascript
const response = await client.getReindex({
  task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
});
```

#### Python

```python
resp = client.get_reindex(
    task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.getReindex(g -> g
    .taskId("r1A2WoRbTwKZ516z6NEs5A:36619")
);
```

#### C#

```c#
var response = await client.GetReindexAsync(taskId: "r1A2WoRbTwKZ516z6NEs5A:36619");
```

#### PHP

```php
$resp = $client->getReindex([
    "task_id" => "r1A2WoRbTwKZ516z6NEs5A:36619",
]);
```

#### Ruby

```ruby
response = client.get_reindex(
  task_id: "r1A2WoRbTwKZ516z6NEs5A:36619"
)
```

## Response Examples

#### In-progress task

A successful response for an in-progress reindex task. The `status` block reports current progress; the `response` block is absent until the task completes.

```json
{
  "completed": false,
  "id": "r1A2WoRbTwKZ516z6NEs5A:36619",
  "description": "reindex from [reindex_src] to [reindex_dst]",
  "start_time_in_millis": 1778265266199,
  "running_time_in_nanos": 1588606084,
  "cancelled": false,
  "status": {
    "total": 0,
    "updated": 0,
    "created": 0,
    "deleted": 0,
    "batches": 0,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
      "bulk": 0,
      "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": 4.0,
    "throttled_until_millis": 0,
    "slices": [
      null,
      null
    ]
  }
}
```

#### Completed task

A successful response for a completed reindex task. The final outcome is in the `response` block.

```json
{
  "completed": true,
  "id": "r1A2WoRbTwKZ516z6NEs5A:36619",
  "description": "reindex from [reindex_src] to [reindex_dst]",
  "start_time_in_millis": 1778265266199,
  "running_time_in_nanos": 35457187167,
  "cancelled": false,
  "status": {
    "total": 240,
    "updated": 0,
    "created": 240,
    "deleted": 0,
    "batches": 120,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
      "bulk": 0,
      "search": 0
    },
    "throttled_millis": 2999,
    "requests_per_second": -1.0,
    "throttled_until_millis": 0,
    "slices": [
      {
        "slice_id": 0,
        "total": 174,
        "updated": 0,
        "created": 174,
        "deleted": 0,
        "batches": 87,
        "version_conflicts": 0,
        "noops": 0,
        "retries": {
          "bulk": 0,
          "search": 0
        },
        "throttled_millis": 999,
        "requests_per_second": -1.0,
        "throttled_until_millis": 0
      },
      {
        "slice_id": 1,
        "total": 66,
        "updated": 0,
        "created": 66,
        "deleted": 0,
        "batches": 33,
        "version_conflicts": 0,
        "noops": 0,
        "retries": {
          "bulk": 0,
          "search": 0
        },
        "throttled_millis": 1999,
        "requests_per_second": -1.0,
        "throttled_until_millis": 0
      }
    ]
  },
  "response": {
    "took": 35434,
    "timed_out": false,
    "total": 240,
    "updated": 0,
    "created": 240,
    "deleted": 0,
    "batches": 120,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
      "bulk": 0,
      "search": 0
    },
    "throttled": "2.9s",
    "throttled_millis": 2999,
    "requests_per_second": -1.0,
    "throttled_until": "0s",
    "throttled_until_millis": 0,
    "slices": [
      {
        "slice_id": 0,
        "total": 174,
        "updated": 0,
        "created": 174,
        "deleted": 0,
        "batches": 87,
        "version_conflicts": 0,
        "noops": 0,
        "retries": {
          "bulk": 0,
          "search": 0
        },
        "throttled": "999.9ms",
        "throttled_millis": 999,
        "requests_per_second": -1.0,
        "throttled_until": "0s",
        "throttled_until_millis": 0
      },
      {
        "slice_id": 1,
        "total": 66,
        "updated": 0,
        "created": 66,
        "deleted": 0,
        "batches": 33,
        "version_conflicts": 0,
        "noops": 0,
        "retries": {
          "bulk": 0,
          "search": 0
        },
        "throttled": "1.9s",
        "throttled_millis": 1999,
        "requests_per_second": -1.0,
        "throttled_until": "0s",
        "throttled_until_millis": 0
      }
    ],
    "failures": []
  }
}
```

