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

# Download a script file

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

## Paths

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

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

Download a script file

## Response

Download script file response.

`application/octet-stream`

Type: `string`

## Code Examples

#### Console

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

#### curl

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

## Response Examples

#### Download script file response example.

```json
null
```

