PATCH /api/endpoint/scripts_library/{script_id}

Spaces method and path for this operation:

patch /s/{space_id}/api/endpoint/scripts_library/{script_id}

Refer to Spaces for more information.

Update (full or partial) a script entry

Path parameters

  • script_id string Required

    The ID of the script entry to be updated.

multipart/form-data

Body Required

  • description string

    Description of the script and its purpose/functionality

  • example string

    Example usage of the script

  • file object(binary)

    The script file upload

  • fileType string

    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 are script or archive.

  • instructions string

    Instructions for using the script, including details around its supported input arguments

  • name string

    Name of the script

  • pathToExecutable string

    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 array[string]

    Platforms supported by the the script

    Values are linux, macos, or windows.

  • requiresInput boolean

    Whether the script requires input arguments

  • tags array[string]

    Tags to categorize the script

    Values are remediationAction, dataCollection, networkDiagnostics, networkAction, systemInventory, forensicCollection, threatHunting, discovery, systemManagement, userManagement, or troubleshooting.

Responses

  • 200 application/json

    Action request was successfully updated

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • 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 array[string]

        Values are linux, macos, or windows.

      • requiresInput boolean
      • tags array[string]

        Tags that categorize the script

        Values are remediationAction, dataCollection, networkDiagnostics, networkAction, systemInventory, forensicCollection, threatHunting, discovery, systemManagement, userManagement, or troubleshooting.

      • updatedAt string(date-time)
      • updatedBy string
      • version string
PATCH /api/endpoint/scripts_library/{script_id}
curl \
 --request PATCH 'https://localhost:5601/api/endpoint/scripts_library/fr518850-681a-4y60-aa98-e22640cae2b8' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: multipart/form-data" \
 --form "instructions=./collect_host_data.sh --help"
Request examples
{"instructions" => "./collect_host_data.sh --help"}
{"fileType" => "script"}
{"fileType" => "archive", "pathToExecutable" => "./bin/collect_host_data.sh"}
Response examples (200)
{
  "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"
    ]
  }
}