Jobs
Cross-bot inventory of running scripts + bulk control. Useful for dashboards that track "what's running where" without polling each bot individually.
| Method | Path | Query |
|---|---|---|
GET | /api/jobs | — |
GET | /api/jobs/by_client | ?client_id |
POST | /api/jobs/stop_all | — |
GET /api/jobs
List every running script across every bot.
Response (200):
{
"jobs": [
{
"client_id": "bot-1",
"script_id": "auto-mine",
"running": true,
"started_at": 1778205616123,
"last_error": null
},
{
"client_id": "bot-2",
"script_id": "auto-fish",
"running": true,
"started_at": 1778205700000,
"last_error": null
},
{
"client_id": "bot-3",
"script_id": "auto-quest",
"running": false,
"started_at": 1778205820000,
"last_error": "executor:88: tile (40,18) not breakable"
}
]
}
started_at is unix-ms when the script first compiled + started;
running:false means the script exited (clean or error) and
hasn't been cleared yet — stays in the list so dashboards can read
the final last_error.
GET /api/jobs/by_client
Filter the same shape down to a single bot.
Query: ?client_id=bot-1
Response (200):
{
"jobs": [
{
"client_id": "bot-1",
"script_id": "auto-mine",
"running": true,
"started_at": 1778205616123,
"last_error": null
}
]
}
POST /api/jobs/stop_all
Cancel every running job across every bot.
Response (200):
{ "stopped": 5 }
stopped is the number of jobs that were running when the call
fired. Each stopped job goes through the same cancellation path
/api/scripts/stop uses — graceful, with the script's
own cleanup() block (if any) running before the runtime disposes
the VM.