---
title: "Execute script within context of given object"
method: POST
path: "/v1/objects/{object-id}/execute-script"
tags: ["Objects"]
---

# Execute script within context of given object

`POST /v1/objects/{object-id}/execute-script`

## Path parameters

- `object-id` integer, required

## Request body

- object
  - `parameters` string[] — Optional list of parameters to be passed to the script
  - `resultAsMap` boolean — If true, result will always be presented as a map (JSON object)
  - `script` string — Source code of the script

## Response `200`

Script executed successfully

## Other responses

- `400` — Invalid arguments
- `401` — Unauthorized
- `403` — User does not have control access to given object
- `404` — Object with given ID does not exist
- `500` — Script execution failed

## Changes

- **2026-05-08** `c6aaf3632e48` — 2 breaking
  - removed the media type `application/json` for the response with the status `200`
  - removed the media type `application/json` for the response with the status `400`

[Change history](https://skmtc.dev/netxms/apis/netxms-api/changes/v1/objects/:object-id/execute-script/post.md)

---

[API](https://skmtc.dev/netxms/apis/netxms-api.md) · [All operations](https://skmtc.dev/netxms/apis/netxms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/netxms/netxms-api/revisions/7ea06a2cad60/schema)
