---
type: api
title: Get the async search status
description: Get the status of a previously submitted async search request given its identifier, without retrieving search results.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-async-search-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-async-search-status
products:
  - Elasticsearch Serverless
---

# Get the async search status

Availability:

## Paths

- `GET` `/_async_search/status/{id}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

#### Path Parameters

- `id` (string Id)
  A unique identifier for the async search.

## Description

Get the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:

* The user or API key that submitted the original async search request.
* Users that have the `monitor` cluster privilege or greater privileges.

## Required authorization

* Cluster privileges: `monitor`

## Query String Parameters

- `keep_alive` (string Duration · default: 5d)
  The length of time that the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.

## Response

`application/json`

- `id` (string Id)
- `is_partial` (boolean)
  When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
- `is_running` (boolean)
  Indicates whether the search is still running or has completed.

> info
> If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
- `expiration_time` (DateTime)
  Indicates when the async search will expire.
- `expiration_time_in_millis` (EpochTimeUnitMillis)
- `start_time` (DateTime)
- `start_time_in_millis` (EpochTimeUnitMillis)
- `completion_time` (DateTime)
  Indicates when the async search completed.
It is present only when the search has completed.
- `completion_time_in_millis` (EpochTimeUnitMillis)
- `error` ({} 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 `error`
  - `root_cause` ([] ErrorCause) — recursive
    Same fields as `error`
  - `suppressed` ([] ErrorCause) — recursive
    Same fields as `error`
- `_shards` ({} ShardStatistics)
  The number of shards that have run the query so far.
  - `failed` (number uint)
    The number of shards the operation or search attempted to run on but failed.
  - `successful` (number uint)
    The number of shards the operation or search succeeded on.
  - `total` (number uint)
    The number of shards the operation or search will run on overall.
  - `failures` ([] ShardFailure)
    - `index` (string IndexName)
    - `node` (string)
    - `reason` ({} 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 `reason` in `failures`
      - `root_cause` ([] ErrorCause) — recursive
        Same fields as `reason` in `failures`
      - `suppressed` ([] ErrorCause) — recursive
        Same fields as `reason` in `failures`
    - `shard` (number)
    - `status` (string)
    - `primary` (boolean)
  - `skipped` (number uint)
- `_clusters` ({} ClusterStatistics)
  Metadata about clusters involved in the cross-cluster search.
It is not shown for local-only searches.
  - `skipped` (number)
  - `successful` (number)
  - `total` (number)
  - `running` (number)
  - `partial` (number)
  - `failed` (number)
  - `details` (map string to ClusterDetails)
    Map values ({} ClusterDetails)
    - `status` (enum ClusterSearchStatus)
      Values: `running`, `successful`, `partial`, `skipped`, `failed`
    - `indices` (string)
    - `took` (DurationValueUnitMillis)
    - `timed_out` (boolean)
    - `_shards` ({} ShardStatistics)
      Same fields as `_shards`
    - `failures` ([] ShardFailure)
      Same fields as `failures` in `_shards`
- `completion_status` (number)
  If the async search completed, this field shows the status code of the search.
For example, `200` indicates that the async search was successfully completed.
`503` indicates that the async search was completed with an error.
## Code Examples

#### Console

```console
GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=
```

#### JavaScript

```javascript
const response = await client.asyncSearch.status({
  id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
});
```

#### Python

```python
resp = client.async_search.status(
    id="FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.asyncSearch().status(s -> s
    .id("FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=")
);
```

#### C#

```c#
var response = await client.AsyncSearch.StatusAsync(id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=");
```

#### PHP

```php
$resp = $client->asyncSearch()->status([
    "id" => "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
]);
```

#### Ruby

```ruby
response = client.async_search.status(
  id: "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc="
)
```

## Response Examples

#### An active async search

A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=`, which retrieves the status of a previously submitted async search without the results.

```json
{
  "id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "_shards" : {
      "total" : 562,
      "successful" : 188, 
      "skipped" : 0,
      "failed" : 0
  }
}
```

#### A completed async search

A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed. The status response has an additional `completion_status` field that shows the status code of the completed async search.

```json
{
  "id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
  "is_running" : false,
  "is_partial" : false,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "_shards" : {
      "total" : 562,
      "successful" : 562,
      "skipped" : 0,
      "failed" : 0
  },
"completion_status" : 200 
}
```

#### A failed async search

A response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed with an error. The status response has an additional `completion_status` field that shows the status code of the completed async search.

```json
{
  "id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
  "is_running" : false,
  "is_partial" : true,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "_shards" : {
      "total" : 562,
      "successful" : 450,
      "skipped" : 0,
      "failed" : 112
  },
"completion_status" : 503 
}
```

