---
title: "Create script"
method: POST
path: "/api/endpoint/scripts_library"
tags: ["Security Endpoint Management API"]
---

# Create script

`POST /api/endpoint/scripts_library`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/scripts_library</span></div>

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

Create a new script entry by uploading a script file

## Response `200`

Action request was successfully created

- SecurityEndpointManagementAPIScriptsApiResponse
  - `data` SecurityEndpointManagementAPIEndpointScript
    - `createdAt` string, date-time
    - `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, uuid
    - `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` SecurityEndpointManagementAPIEndpointScriptPlatform[]
    - `requiresInput` boolean
    - `tags` SecurityEndpointManagementAPIEndpointScriptTags[] — Tags that categorize the script
    - `updatedAt` string, date-time
    - `updatedBy` string
    - `version` string

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
