---
title: "Execute command on agent"
method: POST
path: "/v1/objects/{object-id}/execute-agent-command"
tags: ["Objects"]
---

# Execute command on agent

`POST /v1/objects/{object-id}/execute-agent-command`

## Path parameters

- `object-id` integer, required

## Request body

- object
  - `command` string, required — Command line to execute. Supports macro expansion; the command name is the first token, remaining tokens are passed as arguments.
  - `alarmId` integer — Optional alarm ID used as context for macro expansion. Requires read access to the alarm.
  - `inputFields` object — Optional map of input field values used for macro expansion.

## Response `201`

Command executed successfully

## Other responses

- `401` — Unauthorized
- `403` — User does not have control access to given object
- `404` — Object with given ID does not exist
- `500` — Command 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)
