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

# Get packs

Authentication: required

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

## Paths

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

#### 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.

## Description

Get a list of all query packs.

## Query string parameters

- `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/packs
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/osquery/packs" \
  -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": "2023-10-31T00:00:00Z",
        "created_by": "elastic",
        "description": "My pack description",
        "enabled": true,
        "name": "My Pack",
        "queries": [
          {
            "ecs_mapping": [
              {
                "host.uptime": {
                  "field": "total_seconds"
                }
              }
            ],
            "id": "uptime",
            "interval": "3600",
            "query": "select * from uptime;"
          }
        ],
        "updated_at": "2023-10-31T00:00:00Z",
        "updated_by": "elastic"
      },
      "id": "42ba9c50-0cc5-11ed-aa1d-2b27890bc90d",
      "namespaces": [
        "default"
      ],
      "type": "osquery-pack"
    }
  ],
  "page": 1,
  "pageSize": 10,
  "policy_ids": [],
  "total": 1
}
```

