Skip to content

Depot commands

Registers the command dispatch + status routes.

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

GETendpoint:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

List commands

NameInTypeRequiredDescription
agentIDpathstringYes
pagequeryintegerNoOne-based page number. Defaults to 1.
pageSizequeryintegerNoRows per page, 1 to 200. Defaults to 50.
StatusBodyDescription
200application/json, PagedResultCommandSummarySuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold endpoint:read.
404application/problem+json, ProblemDetailsNo resource matches that id.
500application/problem+json, ProblemDetailsNo client store in request context.

200 response body

FieldTypeDescription
itemsrequiredarray of CommandSummary
items[].commandIdrequiredstring
items[].idempotencyKeyrequiredstring
items[].staterequiredstring
items[].targetAgentIdrequiredstring
items[].typerequiredstring
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/endpoints/<agentID>/commands?page=0&pageSize=0' \
-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]

enqueueCommand validates a run_script request, persists the Command, and pushes a CommandDispatch to the agent’s live stream, advancing the command to “dispatched” on delivery.

When the agent is offline the command is left “pending” and the response reports delivered=false.

A “pending” command IS delivered when the agent reconnects: the telemetry stream drains ListDeliverableCommandsForAgent on registration, and anything past its ExpiresAt flips to “expired” rather than being delivered late. The 202 still reports delivered=false so the console can say “waiting for the endpoint” instead of implying the script has already run.

NameInTypeRequiredDescription
agentIDpathstringYes

Required, sent as application/json.

FieldTypeDescription
argsrequiredarray of string
idempotencyKeyrequiredstring
interpreterrequiredstring
maxOutputBytesrequiredinteger

int64.

paramValuesrequiredobject
runAsSystemrequiredboolean
runAsUserrequiredstring
scriptrequiredstring
scriptIdrequiredstring
timeoutSecondsrequiredinteger
ttlHoursrequiredinteger
StatusBodyDescription
202application/json, CommandAcceptedAccepted.
400application/problem+json, ProblemDetailsOne or more validation errors occurred.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold the required permission.
404application/problem+json, ProblemDetailsEndpoint not found.
409application/problem+json, ProblemDetailsThat idempotency key already belongs to a command on a different endpoint. Use a key of its own for each endpoint you are dispatching to.
422application/problem+json, ProblemDetailsThe request was refused.
500application/problem+json, ProblemDetailsNo client context in request.
502application/problem+json, ProblemDetailsCould not dispatch command to agent.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

202 response body

FieldTypeDescription
commandIdrequiredstring
deliveredrequiredboolean
staterequiredstring
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/endpoints/<agentID>/commands' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"args": [
"string"
],
"idempotencyKey": "string",
"interpreter": "string",
"maxOutputBytes": 0,
"paramValues": {
"key": "string"
},
"runAsSystem": false,
"runAsUser": "string",
"script": "string",
"scriptId": "string",
"timeoutSeconds": 0,
"ttlHours": 0
}'

GET /api/v1/endpoints/{agentID}/commands/{commandID}

Section titled “GET /api/v1/endpoints/{agentID}/commands/{commandID}”

GETendpoint:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

Get command

NameInTypeRequiredDescription
agentIDpathstringYes
commandIDpathstringYes
StatusBodyDescription
200application/json, CommandDetailSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold endpoint:read.
404application/problem+json, ProblemDetailsCommand not found.
500application/problem+json, ProblemDetailsNo client store in request context.

200 response body

FieldTypeDescription
commandIdrequiredstring
idempotencyKeyrequiredstring
paramsrequiredany

Arbitrary JSON.

resultCommandResultView

commandResultView is the terminal (or in-progress) result of a command.

result.completedAtstring (date-time) or null
result.exitCoderequiredinteger
result.startedAtstring (date-time) or null
result.staterequiredstring
result.stderrrequiredstring
result.stdoutrequiredstring
staterequiredstring
targetAgentIdrequiredstring
typerequiredstring
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/endpoints/<agentID>/commands/<commandID>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

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.