Skip to content

Depot shell

Registers the interactive console 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.

GETcommand:executetenant facehosteditmspremoteIdempotentWebSocket

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

Source: [object Object]

shellSocket runs one interactive console for the life of the WebSocket.

Every rejection happens BEFORE the upgrade, so the caller gets a JSON problem document it can render rather than a socket that closes with no explanation.

NameInTypeRequiredDescription
agentIDpathstringYes
interpreterquerystringNo
runAsquerystringNo
StatusBodyDescription
101NoneSwitching protocols. The connection continues as a websocket; see x-outpost-transport.
400application/problem+json, ProblemDetailsOne or more validation errors occurred.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsRemote terminal is disabled by policy for this endpoint
404application/problem+json, ProblemDetailsEndpoint not found.
409application/problem+json, ProblemDetailsEndpoint is not connected, so it cannot open a console.
422application/problem+json, ProblemDetailsThe request was refused.
500application/problem+json, ProblemDetailsNo client context in request.
503application/problem+json, ProblemDetailsThe remote console is not available.
Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This endpoint upgrades to a WebSocket. The sample shows the handshake only.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/endpoints/<agentID>/shell?interpreter=<interpreter>&runAs=<runAs>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

GET /api/v1/endpoints/{agentID}/shell/run-as

Section titled “GET /api/v1/endpoints/{agentID}/shell/run-as”

GETcommand:executetenant facehosteditmspremoteIdempotent

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

Source: [object Object]

getShellRunAs reports whether a console on this endpoint may run as its signed-in user.

The socket refuses before the upgrade with a problem document, but a browser WebSocket cannot read a refused upgrade’s body, so the viewer asks here first and shows the user option disabled with the reason. Same permission as the socket: the answer is only of use to someone who could open one.

NameInTypeRequiredDescription
agentIDpathstringYes
StatusBodyDescription
200application/json, ShellRunAsResponseSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold command:execute.
404application/problem+json, ProblemDetailsEndpoint not found.
500application/problem+json, ProblemDetailsNo client context in request.

200 response body

FieldTypeDescription
shellRunAsUserrequiredShellRunAsVerdict

shellRunAsVerdict is whether this endpoint may open a console as its signed-in user, and if not, why.

shellRunAsUser.allowedrequiredboolean
shellRunAsUser.codestring
shellRunAsUser.reasonstring
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>/shell/run-as' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

GET /api/v1/endpoints/{agentID}/shell/sessions

Section titled “GET /api/v1/endpoints/{agentID}/shell/sessions”

GETendpoint:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

List shell sessions

NameInTypeRequiredDescription
agentIDpathstringYes
pagequeryintegerNoOne-based page number. Defaults to 1.
pageSizequeryintegerNoRows per page, 1 to 200. Defaults to 50.
StatusBodyDescription
200application/json, PagedResultShellSessionViewSuccess.
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 ShellSessionView
items[].actorrequiredstring
items[].agentIdrequiredstring
items[].endReasonrequiredstring
items[].endedAtstring (date-time) or null
items[].eventCountrequiredinteger
items[].interpreterrequiredstring
items[].sessionIdrequiredstring
items[].startedAtrequiredstring (date-time)
items[].staterequiredstring
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>/shell/sessions?page=0&pageSize=0' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

GET /api/v1/endpoints/{agentID}/shell/sessions/{sessionID}

Section titled “GET /api/v1/endpoints/{agentID}/shell/sessions/{sessionID}”

GETendpoint:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

Get shell session

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

200 response body

FieldTypeDescription
actorrequiredstring
agentIdrequiredstring
endReasonrequiredstring
endedAtstring (date-time) or null
eventCountrequiredinteger
eventsrequiredarray of ShellEventView
events[].datarequiredstring
events[].directionrequiredstring
events[].occurredAtrequiredstring (date-time)
events[].seqrequiredinteger

int64.

interpreterrequiredstring
nextSeqrequiredinteger

int64.

sessionIdrequiredstring
startedAtrequiredstring (date-time)
staterequiredstring
truncatedrequiredboolean
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>/shell/sessions/<sessionID>?afterSeq=<afterSeq>' \
-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.