POST /scripts/run
Run a saved script or project with ordinary launcher semantics.
This is a device HTTP route. Set DEVICE_URL to your reachable device URL; connection and examples explain how. Do not append this path to the public MCP URL.
Parameters
| Parameter | Type | Meaning |
|---|---|---|
path | JSON string | Required relative .js file or .cso/.aso directory under Scripts. |
args | JSON object | Optional. Values become strings in the immutable args namespace. |
id | JSON string | Optional standard UUID chosen before submission; returned in uppercase UUID notation. |
repeat | JSON number | Integer 0..10000; default 1; 0 repeats until stopped. |
interval | JSON number | 0..3600 seconds between iterations. If omitted, project metadata may supply a default; otherwise 0. |
Response
JSON {id,path,fullPath,entryPath}. This acknowledges startup, not successful completion.
Example
sh
curl --fail-with-body "$DEVICE_URL/scripts/run" \
-H 'Content-Type: application/json' \
-d '{"path":"Demo.cso","args":{"name":"Alex"},"repeat":1}'Notes
Projects start main.js, falling back to index.js. Use /scripts/runs?id=... to inspect and /scripts/stop with id to cancel. Invalid input returns 400; missing entry, duplicates or launch failure return 409. Never replay an uncertain submission with a new ID.
Check the HTTP status and any JSON error. HTTP workflows and error handling explain shared limits. All endpoints.