ApplesauceOS
Read Markdown ↗Download .md

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

ParameterTypeMeaning
pathJSON stringRequired relative .js file or .cso/.aso directory under Scripts.
argsJSON objectOptional. Values become strings in the immutable args namespace.
idJSON stringOptional standard UUID chosen before submission; returned in uppercase UUID notation.
repeatJSON numberInteger 0..10000; default 1; 0 repeats until stopped.
intervalJSON number0..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.