---
type: api
title: Download a script file
description: Download a script file
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-endpointscriptlibrarydownloadscript
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-endpointscriptlibrarydownloadscript
products:
  - Kibana
---

# Download a script file

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

## Paths

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

#### Path parameters

- `script_id` (string · max length: 256) — required
  The ID of the script entry.
  Example: `fr518850-681a-4y60-aa98-e22640cae2b8`

## Description

Download a script file

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

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

```json
null
```

