---
title: "Get saved query details"
method: GET
path: "/api/osquery/saved_queries/{id}"
tags: ["Security Osquery API"]
---

# Get saved query details

`GET /api/osquery/saved_queries/{id}`

**Spaces method and path for this operation:**

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/osquery/saved_queries/{id}</span></div>

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

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

## Path parameters

- `id` string, required — The ID of a saved query.

## Response `200`

Indicates a successful call.

- SecurityOsqueryAPIFindSavedQueryDetailResponse — The details of a single saved query.
  - `data` object, required
    - `created_at` string, date-time
    - `created_by` string, nullable
    - `created_by_profile_uid` string
    - `description` string — The saved query description.
    - `ecs_mapping` SecurityOsqueryAPIECSMapping — Map osquery results columns or static values to Elastic Common Schema (ECS) fields
    - `id` string, required — The ID of a saved query.
    - `interval` union
      - integer
      - string
    - `platform` string — Restricts the query to a specified platform. The default is all platforms. To specify multiple platforms, use commas. For example, `linux,darwin`.
    - `prebuilt` boolean
    - `query` string — The SQL query you want to run.
    - `removed` boolean — Indicates whether the query is removed.
    - `saved_object_id` string, required
    - `snapshot` boolean — Indicates whether the query is a snapshot.
    - `timeout` integer
    - `updated_at` string, date-time
    - `updated_by` string, nullable
    - `updated_by_profile_uid` string
    - `version` union
      - integer
      - string

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
