Skip to content

Depot scriptruns

Registers the bulk-run and batch routes on the TENANT mux.

This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.

GETscript:readtenant facehosteditmspremoteIdempotent

From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.

Source: [object Object]

List script batches

NameInTypeRequiredDescription
dirquerystring, one of asc, descNoSort direction.
pagequeryintegerNoOne-based page number. Defaults to 1.
pageSizequeryintegerNoRows per page, 1 to 200. Defaults to 50.
qquerystringNoFree-text search term.
scriptIdquerystringNo
sortquerystring, one of created, endpoints, expires, scriptNoSort key.
statequerystringNo
StatusBodyDescription
200application/json, PagedResultScriptBatchViewSuccess.
400application/problem+json, ProblemDetailsOne or more validation errors occurred.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold script:read.
500application/problem+json, ProblemDetailsNo client store in request context.

200 response body

FieldTypeDescription
itemsrequiredarray of ScriptBatchView
items[].cancelledAtstring (date-time) or null
items[].createdAtrequiredstring (date-time)
items[].createdByrequiredstring
items[].expiresAtrequiredstring (date-time)
items[].publicIdrequiredstring
items[].runAsrequiredstring
items[].scriptNamerequiredstring
items[].scriptPublicIdrequiredstring
items[].scriptVersionrequiredinteger
items[].targetKindrequiredstring
items[].timeoutSecondsrequiredinteger
items[].totalEndpointsrequiredinteger
pagerequiredinteger
pageSizerequiredinteger
totalrequiredinteger
Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/script-batches?dir=asc&page=0&pageSize=0&q=<q>&scriptId=<scriptId>&sort=created' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

GETscript:readtenant facehosteditmspremoteIdempotent

From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.

Source: [object Object]

Get script batch

NameInTypeRequiredDescription
batchIdpathstringYesA uuid.
pagequeryintegerNoOne-based page number. Defaults to 1.
pageSizequeryintegerNoRows per page, 1 to 200. Defaults to 50.
StatusBodyDescription
200application/json, ScriptBatchDetailViewSuccess.
400application/problem+json, ProblemDetailsOne or more validation errors occurred.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold script:read.
404application/problem+json, ProblemDetailsNo resource matches that id.
500application/problem+json, ProblemDetailsNo client store in request context.

200 response body

FieldTypeDescription
batchrequiredScriptBatchView
batch.cancelledAtstring (date-time) or null
batch.createdAtrequiredstring (date-time)
batch.createdByrequiredstring
batch.expiresAtrequiredstring (date-time)
batch.publicIdrequiredstring
batch.runAsrequiredstring
batch.scriptNamerequiredstring
batch.scriptPublicIdrequiredstring
batch.scriptVersionrequiredinteger
batch.targetKindrequiredstring
batch.timeoutSecondsrequiredinteger
batch.totalEndpointsrequiredinteger
countsrequiredobject
rowsrequiredPagedResultScriptBatchRowView

PagedResult is the generic envelope for paginated list responses.

rows.itemsrequiredarray of ScriptBatchRowView
rows.items[].agentIdrequiredstring
rows.items[].commandIdrequiredstring
rows.items[].completedAtstring (date-time) or null
rows.items[].exitCodeinteger or null
rows.items[].hostnamerequiredstring
rows.items[].startedAtstring (date-time) or null
rows.items[].staterequiredstring
rows.pagerequiredinteger
rows.pageSizerequiredinteger
rows.totalrequiredinteger
Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/script-batches/<batchId>?page=0&pageSize=0' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POST /api/v1/script-batches/{batchId}/cancel

Section titled “POST /api/v1/script-batches/{batchId}/cancel”

POSTcommand:executetenant facehosteditmspremote

From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.

Source: [object Object]

Cancel script batch

NameInTypeRequiredDescription
batchIdpathstringYesA uuid.
StatusBodyDescription
200application/json, ScriptBatchCancelledSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold command:execute.
404application/problem+json, ProblemDetailsNo resource matches that id.
500application/problem+json, ProblemDetailsNo client store in request context.

200 response body

FieldTypeDescription
cancelledrequiredinteger

int64.

Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
curl -X POST 'https://depot.example.com/api/v1/script-batches/<batchId>/cancel' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POSTcommand:executetenant facehosteditmspremoteIdempotent

From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.

Source: [object Object]

runScriptBatch resolves the script through the two-library ladder rather than the control store, so a client’s OWN script is runnable across that client’s fleet.

Reading only the shared library here would leave every client-scoped script un-runnable in bulk, behind a 404 naming nothing.

NameInTypeRequiredDescription
scriptIdpathstringYesA uuid.

Required, sent as application/json.

FieldTypeDescription
expectedBodySha256requiredstring
paramValuesrequiredobject
runAsrequiredstring
targetrequiredTarget

Target is a run's endpoint selection, exactly as the console submitted it.

target.agentIdsarray of string
target.groupIdsarray of string
target.includeChildSitesboolean
target.kindrequiredstring
target.siteIdsarray of string
timeoutSecondsrequiredinteger
ttlHoursrequiredinteger
StatusBodyDescription
202application/json, ScriptRunAcceptedAccepted.
400application/problem+json, ProblemDetailsThe request body is not valid JSON.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold command:execute.
404application/problem+json, ProblemDetailsNo resource matches that id.
409application/problem+json, ProblemDetailsThe script changed after it was shown for approval. Review it again before running it.
422application/problem+json, ProblemDetailsThe request was refused.
500application/problem+json, ProblemDetailsNo client context in request.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

202 response body

FieldTypeDescription
batchIdrequiredstring
dispatchedrequiredinteger
pendingrequiredinteger
skippedrequiredarray of Skipped
skipped[].agentIdrequiredstring
skipped[].hostnamerequiredstring
skipped[].reasonrequiredstring
totalrequiredinteger
Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X POST 'https://depot.example.com/api/v1/scripts/<scriptId>/runs' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"expectedBodySha256": "string",
"paramValues": {
"key": "string"
},
"runAs": "string",
"target": {
"agentIds": [
"string"
],
"groupIds": [
"string"
],
"includeChildSites": false,
"kind": "string",
"siteIds": [
"string"
]
},
"timeoutSeconds": 0,
"ttlHours": 0
}'

Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.