---
type: api
title: Get live query details
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-osquerygetlivequerydetails
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-osquerygetlivequerydetails
products:
  - Kibana
---

# Get live query details

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/osquery/live_queries/{id}`
- `GET` `/s/{space_id}/api/osquery/live_queries/{id}`

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

#### Path Parameters

- `id` (string)
  The ID of the live query.

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Get the details of a live query using the query ID.

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `data` (object)
  - `@timestamp` (string)
  - `action_id` (string)
  - `agents` ([] string)
  - `expiration` (string)
  - `pack_id` (string)
  - `pack_name` (string)
  - `prebuilt_pack` (boolean)
  - `queries` ([] object)
    The queries with their execution status.
    - `action_id` (string)
    - `agents` ([] string)
    - `docs` (integer)
      Number of result documents.
    - `ecs_mapping` (object)
      Map osquery results columns or static values to Elastic Common Schema (ECS) fields
    - `failed` (integer)
      Number of failed queries.
    - `id` (string)
    - `pending` (integer)
      Number of pending agents.
    - `query` (string)
    - `responded` (integer)
      Total responded agents.
    - `saved_query_id` (string)
    - `status` (enum)
      Status of this individual query.
      Values: `completed`, `running`
    - `successful` (integer)
      Number of successful agents.
  - `status` (enum)
    Global status of the live query (completed, running).
    Values: `completed`, `running`
  - `tags` ([] string)
  - `user_id` (string)
  - `user_profile_uid` (string)
#### `404`

No live query with this `id` exists in the current space. Live queries issued from another space also return 404.

`application/json`

- `message` (string)
## Code Examples

#### Console

```console
GET /api/osquery/live_queries/{id}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/osquery/live_queries/{id}"
```

## Response Examples

#### Live query details with execution status

```json
{
  "data": {
    "@timestamp": "2022-07-26T09:59:32.220Z",
    "action_id": "3c42c847-eb30-4452-80e0-728584042334",
    "agents": [
      "16d7caf5-efd2-4212-9b62-73dafc91fa13"
    ],
    "expiration": "2022-07-26T10:04:32.220Z",
    "queries": [
      {
        "action_id": "609c4c66-ba3d-43fa-afdd-53e244577aa0",
        "agents": [
          "16d7caf5-efd2-4212-9b62-73dafc91fa13"
        ],
        "docs": 1,
        "failed": 0,
        "id": "6724a474-cbba-41ef-a1aa-66aebf0879e2",
        "pending": 0,
        "query": "select * from uptime;",
        "responded": 1,
        "status": "completed",
        "successful": 1
      }
    ],
    "status": "completed",
    "user_id": "elastic"
  }
}
```

#### The live query does not exist in the current space

```json
{
  "message": "Action not found"
}
```

