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

# Execute dashboard element script within context of given object

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

Execute an NXSL script embedded in a dashboard element against a context object and return the result as a string map.

## Path parameters

- `object-id` integer, required — Dashboard or dashboard template object ID

## Request body

- object
  - `objectId` integer — Context object ID for script execution. If omitted or 0, the dashboard object itself is used as context.
  - `elementIndex` integer, required — Index of the dashboard element containing the script

## Response `200`

Script executed successfully

- object
  - `result` object — Map of string key-value pairs with script execution results

## Other responses

- `400` — Invalid arguments or script compilation error
- `401` — Unauthorized
- `403` — User does not have read access to the dashboard or context object
- `404` — Dashboard or context 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/14d93e5115dd/schema)
