---
title: "Create new script"
method: POST
path: "/v1/script-library"
tags: ["Script Library"]
---

# Create new script

`POST /v1/script-library`

Create a new script in the script library.

## 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 `201`

Script created successfully

- object
  - `id` integer — ID of the newly created 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
- `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)
