---
type: api
title: Get saved query details
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-osquerygetsavedquerydetails
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-osquerygetsavedquerydetails
products:
  - Kibana
---

# Get saved query details

Authentication: required

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

## Paths

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

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `id` (string) — required
  Example: `3c42c847-eb30-4452-80e0-728584042334`

## Description

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

## Response

OK

`application/json`

Type: `object`

## Code examples

#### Console

```console
GET kbn:/api/osquery/saved_queries/3c42c847-eb30-4452-80e0-728584042334
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/osquery/saved_queries/3c42c847-eb30-4452-80e0-728584042334" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## 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
{
  "data": {
    "attributes": {
      "created_at": "2022-07-26T09:28:08.597Z",
      "created_by": "elastic",
      "description": "Saved query description",
      "ecs_mapping": {
        "host.uptime": {
          "field": "total_seconds"
        }
      },
      "id": "saved_query_id",
      "interval": "60",
      "platform": "linux,darwin",
      "prebuilt": false,
      "query": "select * from uptime;",
      "updated_at": "2022-07-26T09:28:08.597Z",
      "updated_by": "elastic",
      "version": "2.8.0"
    },
    "coreMigrationVersion": "8.4.0",
    "id": "3c42c847-eb30-4452-80e0-728584042334",
    "namespaces": [
      "default"
    ],
    "references": [],
    "type": "osquery-saved-query",
    "updated_at": "2022-07-26T09:28:08.600Z",
    "version": "WzQzMTcsMV0="
  }
}
```

