MikroTik API icon

MikroTik API

Community Node for MikroTik RouterOS API

Actions67

System Script → Run

AI-generated

Summary

Run a system script on the MikroTik device.

Inputs

  • targetId (required) — ID (*1, *2) or Name (ether1, user1) of the script to run
  • connectionAttempts — Number of times to try connecting, default 5
  • connectionDelay — Delay between attempts in seconds, default 3
  • cleanKeys — Replace - and / with _ in response keys, default false
  • tag — Custom tag for the command, default 0

Output shape

{ resource, operation, count, data } where data is the RouterOS API response; if cleanKeys is true and data is an array, response keys have - and / replaced with _

The script identifier (targetId) is passed as .id parameter to /system/script/run. A tag value > 0 adds .tag= to the API params.

Examples

Example 1: Execute script named 'test-script' with 2 retry attempts and 1-second delay

targetId: 'test-script'; connectionAttempts: 2; connectionDelay: 1; other options at defaults

Links

Discussion