---
type: api
title: Download a script file
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-endpointscriptlibrarydownloadscript
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-endpointscriptlibrarydownloadscript
products:
  - Kibana
---

# Download a script file

Authentication: required

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

## Paths

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

#### 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.
- `script_id` (string · max length: 256) — required
  The ID of the script entry.
  Example: `fr518850-681a-4y60-aa98-e22640cae2b8`

## Description

Download a script file

## Response

Download script file response.

`application/octet-stream`

Type: `string · format: binary`

## Code examples

#### Console

```console
GET kbn:/api/endpoint/scripts_library/fr518850-681a-4y60-aa98-e22640cae2b8/download
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/endpoint/scripts_library/fr518850-681a-4y60-aa98-e22640cae2b8/download" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Download script file response example.

`application/octet-stream`

```json
null
```

