---
type: api
title: Update script
description: Update (full or partial) a script entry
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-endpointscriptlibrarypatchupdatescript
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-endpointscriptlibrarypatchupdatescript
products:
  - Kibana
---

# Update script

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

## Paths

- `PATCH` `/api/endpoint/scripts_library/{script_id}`

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

#### Path Parameters

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

## Description

Update (full or partial) a script entry

## Request Body

`multipart/form-data`

- `description` (string · max: 10000) — optional
  Description of the script and its purpose/functionality
- `example` (string · max: 10000) — optional
  Example usage of the script
- `file` (object) — optional
  The script file upload
- `fileType` (enum) — optional
  The type of the uploaded file, which determines the expected value of `pathToExecutable`. If `fileType` is "script", then `pathToExecutable` should not be included. If `fileType` is "archive", then `pathToExecutable` is required and should specify the path to the executable file within the archive.
  Values: `script`, `archive`
- `instructions` (string · max: 10000) — optional
  Instructions for using the script, including details around its supported input arguments
- `name` (string · min: 1 · max: 256) — optional
  Name of the script
- `pathToExecutable` (string · max: 4096) — optional
  Used only for when the uploaded script is an archive (.zip file for example). This property defines the relative path to the file included in the archive that should be executed once its contents are extracted. The path should be relative to the root of the archive.
- `platform` ([] enum) — optional
  Platforms supported by the the script
  Values: `linux`, `macos`, `windows`
- `requiresInput` (boolean) — optional
  Whether the script requires input arguments
- `tags` ([] enum) — optional
  Tags to categorize the script
  Values: `remediationAction`, `dataCollection`, `networkDiagnostics`, `networkAction`, `systemInventory`, `forensicCollection`, `threatHunting`, `discovery`, `systemManagement`, `userManagement`, `troubleshooting`
- `version` (string · min: 1 · max: 256) — optional
  Version of the script

## Response

Action request was successfully updated

`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
PATCH /api/endpoint/scripts_library/{script_id}
{
  "instructions": "./collect_host_data.sh --help"
}
```

#### curl

```curl
curl -X PATCH "https://{kibana_url}/api/endpoint/scripts_library/{script_id}" \
  -H "Content-Type: multipart/form-data" \
  -d '{
  "instructions": "./collect_host_data.sh --help"
}'
```

## Response Examples

#### Update 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"
    ]
  }
}
```

