---
type: api
title: Get a list of scripts
description: Retrieve a list of scripts
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-endpointscriptlibrarylistscripts
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-endpointscriptlibrarylistscripts
products:
  - Kibana
---

# Get a list of scripts

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

## Paths

- `GET` `/api/endpoint/scripts_library`

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

## Description

Retrieve a list of scripts

## Query String Parameters

- `page` (integer · min: 1 · default: 1)
  Page number of the results to return. Defaults to 1.
- `pageSize` (integer · min: 1 · max: 1000 · default: 10)
  Number of results to return per page. Defaults to 10. Max value is 1000.
- `sortField` (enum)
  The field to sort the results by. Defaults to name.
  Values: `name`, `createdAt`, `createdBy`, `updatedAt`, `updatedBy`, `fileSize`
- `sortDirection` (enum)
  The direction to sort the results by. Defaults to asc (ascending).
  Values: `asc`, `desc`
- `kuery` (string)
  A KQL query string to filter the list of scripts. Nearly all fields in the script object are searchable.

## Response

List of scripts response

`application/json`

- `data` ([] object)
  - `createdAt` (string)
  - `createdBy` (string)
  - `description` (string)
    Description of the script and its purpose/functionality
  - `downloadUri` (string)
    URI to download the script file. Note that this is the relative path and does not include the space (if applicable)
  - `example` (string)
  - `fileHash` (string)
    SHA256 hash of the script file that was uploaded
  - `fileName` (string)
    Name of the script file that was uploaded
  - `fileSize` (integer)
    Size of the script file that was uploaded in bytes
  - `id` (string)
  - `instructions` (string)
    Instructions for using the script, including details around its supported input arguments
  - `name` (string)
  - `pathToExecutable` (string)
    The relative path to the file included in the archive that should be executed once its contents are extracted. Applicable only for scripts uploaded as an archive (.zip file for example).
  - `platform` ([] enum)
    Values: `linux`, `macos`, `windows`
  - `requiresInput` (boolean)
  - `tags` ([] enum)
    Tags that categorize the script
    Values: `remediationAction`, `dataCollection`, `networkDiagnostics`, `networkAction`, `systemInventory`, `forensicCollection`, `threatHunting`, `discovery`, `systemManagement`, `userManagement`, `troubleshooting`
  - `updatedAt` (string)
  - `updatedBy` (string)
  - `version` (string)
- `page` (integer · min: 1 · default: 1)
  Page number
- `pageSize` (integer · min: 1 · max: 1000 · default: 10)
  Number of items per page
- `sortDirection` (enum)
  Determines the sort order.
  Values: `asc`, `desc`
- `sortField` (enum)
  Determines which field is used to sort the results.
  Values: `name`, `createdAt`, `createdBy`, `updatedAt`, `updatedBy`, `fileSize`
- `total` (integer)
  The total number of scripts matching the query
## Code Examples

#### Console

```console
GET /api/endpoint/scripts_library
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/endpoint/scripts_library"
```

## Response Examples

#### List of scripts response example

```json
{
  "data": [],
  "page": 1,
  "pageSize": 10,
  "sortDirection": "asc",
  "sortField": "name",
  "total": 100
}
```

