---
title: "Get a list of scripts"
method: GET
path: "/api/endpoint/scripts_library"
tags: ["Security Endpoint Management API"]
---

# Get a list of scripts

`GET /api/endpoint/scripts_library`

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

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

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

Retrieve a list of scripts

## Query parameters

- `page` integer — Page number
- `pageSize` integer — Number of items per page
- `sortField` 'name' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy' | 'fileSize' — Determines which field is used to sort the results.
- `sortDirection` 'asc' | 'desc' — Determines the sort order.
- `kuery` string — A KQL string.

## Response `200`

List of scripts response

- object
  - `data` SecurityEndpointManagementAPIEndpointScript[]
    - `createdAt` string, date-time
    - `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, uuid
    - `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` SecurityEndpointManagementAPIEndpointScriptPlatform[]
    - `requiresInput` boolean
    - `tags` SecurityEndpointManagementAPIEndpointScriptTags[] — Tags that categorize the script
    - `updatedAt` string, date-time
    - `updatedBy` string
    - `version` string
  - `page` integer — Page number
  - `pageSize` integer — Number of items per page
  - `sortDirection` 'asc' | 'desc' — Determines the sort order.
  - `sortField` 'name' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy' | 'fileSize' — Determines which field is used to sort the results.
  - `total` integer — The total number of scripts matching the query

---

[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)
