---
type: api
title: Get live queries
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-osqueryfindlivequeries
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-osqueryfindlivequeries
products:
  - Kibana
---

# Get live queries

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

## Paths

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

## Description

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

Get a list of all live queries.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `kuery` (string) — optional — nullable
  Example: `agent.id: 16d7caf5-efd2-4212-9b62-73dafc91fa13`
- `page` (integer) — optional — nullable
- `pageSize` (integer) — optional — nullable
- `sort` (string · default: createdAt) — optional — nullable
- `sortOrder` (enum) — optional
  Values: `asc`, `desc`

## Response

OK

`application/json`

Type: `object`

## Code examples

#### Console

```console
GET kbn:/api/osquery/live_queries
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/osquery/live_queries" \
  -H "Authorization: ApiKey ${API_KEY}"
```

