---
type: api
title: Get the async SQL search status
description: Get the current status of an async SQL search or a stored synchronous SQL search.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-sql-get-async-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-sql-get-async-status
products:
  - Elasticsearch
---

# Get the async SQL search status

Availability: 7.15+

## Paths

- `GET` `/_sql/async/status/{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

- `id` (string Id)
  The identifier for the search.

## Description

Get the current status of an async SQL search or a stored synchronous SQL search.

## Required authorization

* Cluster privileges: `monitor`

## Response

`application/json`

- `expiration_time_in_millis` (EpochTimeUnitMillis)
  The timestamp, in milliseconds since the Unix epoch, when Elasticsearch will delete the search and its results, even if the search is still running.
- `id` (string)
  The identifier for the search.
- `is_running` (boolean)
  If `true`, the search is still running.
If `false`, the search has finished.
- `is_partial` (boolean)
  If `true`, the response does not contain complete search results.
If `is_partial` is `true` and `is_running` is `true`, the search is still running.
If `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout.
- `start_time_in_millis` (EpochTimeUnitMillis)
  The timestamp, in milliseconds since the Unix epoch, when the search started.
The API returns this property only for running searches.
- `completion_status` (number uint)
  The HTTP status code for the search.
The API returns this property only for completed searches.
## Code Examples

#### Console

```console
GET _sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=
```

#### JavaScript

```javascript
const response = await client.sql.getAsyncStatus({
  id: "FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=",
});
```

#### Python

```python
resp = client.sql.get_async_status(
    id="FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_sql/async/status/FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.sql().getAsyncStatus(g -> g
    .id("FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=")
);
```

#### C#

```c#
var response = await client.Sql.GetAsyncStatusAsync(id: "FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=");
```

#### PHP

```php
$resp = $client->sql()->getAsyncStatus([
    "id" => "FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=",
]);
```

#### Ruby

```ruby
response = client.sql.get_async_status(
  id: "FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU="
)
```

