ReferenceHTTP API
scriptRunner
The scriptRunner router: 3 methods of the script-runner capability, with tier, scope, input and output.
Capability script-runner · scope device · mode singleton · source packages/types/src/capabilities/script-runner.cap.ts:34.
Every method is called at /trpc/scriptRunner.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getStatus | query | protected | view | yes |
run | mutation | admin | admin only | no |
stop | mutation | admin | admin only | no |
scriptRunner.getStatus
- Kind: query —
GET /trpc/scriptRunner.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityscript-runner, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=scriptRunner.getStatuson your hub
Input
{ deviceId: number }Output
ScriptRunnerStatusSchemaShapes: ScriptRunnerStatusSchema
scriptRunner.run
- Kind: mutation —
POST /trpc/scriptRunner.run - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=scriptRunner.runon your hub
Input
{ deviceId: number; variables?: Record<string, unknown> }Output
voidscriptRunner.stop
- Kind: mutation —
POST /trpc/scriptRunner.stop - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=scriptRunner.stopon your hub
Input
{ deviceId: number }Output
void