---
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/4641/api/doc/elasticsearch/v8/operation/operation-sql-get-async-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v8/operation/operation-sql-get-async-status
products:
  - Elasticsearch
---

# Get the async SQL search status

Authentication: required

Availability: Generally available since 7.15

## Paths

- `GET` `/_sql/async/status/{id}`

#### Path parameters

- `id` (string) — required
  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` (number)
  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` (number)
  The timestamp, in milliseconds since the Unix epoch, when the search started.
The API returns this property only for running searches.
- `completion_status` (number)
  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="
)
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "expiration_time_in_millis": 0,
  "id": "string",
  "is_running": false,
  "is_partial": false,
  "start_time_in_millis": 0,
  "completion_status": 0
}
```

