---
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

- object
  - `result` unknown

## Other responses

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

---

[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/ee1f54ee3abd/schema)
