---
title: "Update script"
method: PUT
path: "/v1/script-library/{script-id}"
tags: ["Script Library"]
---

# Update script

`PUT /v1/script-library/{script-id}`

Update an existing script's name and/or code.

## Path parameters

- `script-id` integer, required

## Request body

- object
  - `name` string, required — Script name (alphanumeric, underscore, colon; must not start with digit or colon)
  - `code` string, required — NXSL source code

## Response `200`

Script updated successfully

- object
  - `id` integer — ID of the updated script

## Other responses

- `400` — Missing or invalid name/code, or invalid script name format
- `401` — Unauthorized
- `403` — User does not have SYSTEM_ACCESS_MANAGE_SCRIPTS permission
- `404` — Script with given ID does not exist
- `500` — Database failure

---

[API](https://skmtc.net/netxms/apis/netxms-api.md) · [All operations](https://skmtc.net/netxms/apis/netxms-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netxms/netxms-api/versions/14d93e5115dd/schema)
