---
type: api
title: Get script
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-endpointscriptlibrarygetonescript
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-endpointscriptlibrarygetonescript
products:
  - Kibana
---

# Get script

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

## Paths

- `GET` `/api/endpoint/scripts_library/{script_id}`
- `GET` `/s/{space_id}/api/endpoint/scripts_library/{script_id}`

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

#### Path Parameters

- `script_id` (string · max: 256)
  The ID of the script entry.

## Description

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

Get a script

## Response

Get script response

`application/json`

- `data` ({})
  - `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)
## Code Examples

#### Console

```console
GET /api/endpoint/scripts_library/{script_id}
```

#### curl

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

## Response Examples

#### Get one script entry success

```json
{
  "data": {
    "description": "Collects host data for investigation",
    "file": "./collect_host_data.sh",
    "fileType": "script",
    "id": 1234567890,
    "instructions": "No arguments required",
    "name": "Collect host data",
    "platform": [
      "linux",
      "macos"
    ]
  }
}
```

