Skip to content

Depot scriptapprovals

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

GETscript:readshared facehosteditmspremoteIdempotent

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

Source: [object Object]

List body approvals

NameInTypeRequiredDescription
statequerystringNo
StatusBodyDescription
200application/json, PagedResultBodyApprovalViewSuccess.
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, ProblemDetailsOpen a client to approve scripts typed for its endpoints.
500application/problem+json, ProblemDetailsThe request failed.

200 response body

FieldTypeDescription
itemsrequiredarray of BodyApprovalView
items[].bodyrequiredstring
items[].bodySha256requiredstring
items[].decidedAtstring (date-time) or null
items[].decidedBystring
items[].expiresAtrequiredstring (date-time)
items[].interpreterrequiredstring
items[].publicIdrequiredstring
items[].requestedAtrequiredstring (date-time)
items[].requestedByrequiredstring
items[].requestedByNamestring
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/script-body-approvals?state=<state>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POSTscript:run_unapprovedshared facehosteditmspremote

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

Source: [object Object]

Request body approval

Required, sent as application/json.

FieldTypeDescription
bodyrequiredstring
interpreterrequiredstring
StatusBodyDescription
201application/json, BodyApprovalViewCreated.
400application/problem+json, ProblemDetailsThe request body is not valid JSON.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsOnly a signed-in operator can ask for an approval.
404application/problem+json, ProblemDetailsOpen a client to approve scripts typed for its endpoints.
500application/problem+json, ProblemDetailsThe request failed.

201 response body

FieldTypeDescription
bodyrequiredstring
bodySha256requiredstring
decidedAtstring (date-time) or null
decidedBystring
expiresAtrequiredstring (date-time)
interpreterrequiredstring
publicIdrequiredstring
requestedAtrequiredstring (date-time)
requestedByrequiredstring
requestedByNamestring
staterequiredstring
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-body-approvals' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"body": "string",
"interpreter": "string"
}'

POST /api/v1/script-body-approvals/{approvalId}/approve

Section titled “POST /api/v1/script-body-approvals/{approvalId}/approve”

POSTscript:approveshared facehosteditmspremoteIdempotent

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

Source: [object Object]

Decide body approval

NameInTypeRequiredDescription
approvalIdpathstringYesA uuid.
StatusBodyDescription
200application/json, BodyApprovalViewSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsOnly a signed-in operator can decide an approval.
404application/problem+json, ProblemDetailsOpen a client to approve scripts typed for its endpoints.
409application/problem+json, ProblemDetailsThis request has already been decided, has expired, or is yours. The decision is somebody else’s.
500application/problem+json, ProblemDetailsCould not record the decision.

200 response body

FieldTypeDescription
bodyrequiredstring
bodySha256requiredstring
decidedAtstring (date-time) or null
decidedBystring
expiresAtrequiredstring (date-time)
interpreterrequiredstring
publicIdrequiredstring
requestedAtrequiredstring (date-time)
requestedByrequiredstring
requestedByNamestring
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/script-body-approvals/<approvalId>/approve' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POST /api/v1/script-body-approvals/{approvalId}/reject

Section titled “POST /api/v1/script-body-approvals/{approvalId}/reject”

POSTscript:approveshared facehosteditmspremoteIdempotent

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

Source: [object Object]

Decide body approval

NameInTypeRequiredDescription
approvalIdpathstringYesA uuid.
StatusBodyDescription
200application/json, BodyApprovalViewSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsOnly a signed-in operator can decide an approval.
404application/problem+json, ProblemDetailsOpen a client to approve scripts typed for its endpoints.
409application/problem+json, ProblemDetailsThis request has already been decided, has expired, or is yours. The decision is somebody else’s.
500application/problem+json, ProblemDetailsCould not record the decision.

200 response body

FieldTypeDescription
bodyrequiredstring
bodySha256requiredstring
decidedAtstring (date-time) or null
decidedBystring
expiresAtrequiredstring (date-time)
interpreterrequiredstring
publicIdrequiredstring
requestedAtrequiredstring (date-time)
requestedByrequiredstring
requestedByNamestring
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/script-body-approvals/<approvalId>/reject' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POSTscript:approveshared facehosteditmspremoteIdempotent

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

Source: [object Object]

rejectScript turns down a script waiting for approval.

Not by whoever asked: a decision is the second person’s.

NameInTypeRequiredDescription
scriptIdpathstringYesA uuid.
StatusBodyDescription
200application/json, ScriptDetailViewSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThis script is in the shared library, which every workspace on this Depot reads, and it is not edited from inside one of them. Duplicate it and change your own copy instead.
404application/problem+json, ProblemDetailsNo resource matches that id.
409application/problem+json, ProblemDetailsYou asked for this approval, so the decision is somebody else’s.
500application/problem+json, ProblemDetailsThe request failed.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

200 response body

FieldTypeDescription
approvalClearedboolean
approvalFloorFrameworksarray of string
approvalReasonstring
approvalTicketstring
approvedAtstring (date-time) or null
approvedBystring
approvedByNamestring
approvedViastring
bodyrequiredstring
bodySha256requiredstring
builtInrequiredboolean
categoryrequiredstring
collectorFieldKeyrequiredstring
collectorParseModerequiredstring
descriptionrequiredstring
interpreterrequiredstring
isCollectorrequiredboolean
maxOutputBytesrequiredinteger

int64.

namerequiredstring
osFamilyrequiredstring, one of any, linux, macos, windows
ownWorkboolean
paramsrequiredarray of ScriptParamView
params[].defaultrequiredstring
params[].descriptionrequiredstring
params[].keyrequiredstring
params[].kindrequiredstring
params[].labelrequiredstring
params[].optionsrequiredarray of string
params[].requiredrequiredboolean
publicIdrequiredstring
runAsDefaultrequiredstring
scoperequiredstring
secondPersonApprovedrequiredboolean
soleEditorboolean
statusrequiredstring
tagsrequiredarray of string
timeoutSecondsrequiredinteger
updatedAtrequiredstring (date-time)
versionrequiredinteger
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>/reject' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POST /api/v1/scripts/{scriptId}/request-approval

Section titled “POST /api/v1/scripts/{scriptId}/request-approval”

POSTscript:manageshared facehosteditmspremoteIdempotent

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

Source: [object Object]

requestScriptApproval puts a draft or rejected script on the waiting list (pending_approval).

The requester is stamped where the decision will be, “ApprovedByUserPublicId”, which records whoever moved the approval last.

NameInTypeRequiredDescription
scriptIdpathstringYesA uuid.
StatusBodyDescription
200application/json, ScriptDetailViewSuccess.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThis script is in the shared library, which every workspace on this Depot reads, and it is not edited from inside one of them. Duplicate it and change your own copy instead.
404application/problem+json, ProblemDetailsNo resource matches that id.
409application/problem+json, ProblemDetailsThe request conflicts with the current state.
500application/problem+json, ProblemDetailsThe request failed.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

200 response body

FieldTypeDescription
approvalClearedboolean
approvalFloorFrameworksarray of string
approvalReasonstring
approvalTicketstring
approvedAtstring (date-time) or null
approvedBystring
approvedByNamestring
approvedViastring
bodyrequiredstring
bodySha256requiredstring
builtInrequiredboolean
categoryrequiredstring
collectorFieldKeyrequiredstring
collectorParseModerequiredstring
descriptionrequiredstring
interpreterrequiredstring
isCollectorrequiredboolean
maxOutputBytesrequiredinteger

int64.

namerequiredstring
osFamilyrequiredstring, one of any, linux, macos, windows
ownWorkboolean
paramsrequiredarray of ScriptParamView
params[].defaultrequiredstring
params[].descriptionrequiredstring
params[].keyrequiredstring
params[].kindrequiredstring
params[].labelrequiredstring
params[].optionsrequiredarray of string
params[].requiredrequiredboolean
publicIdrequiredstring
runAsDefaultrequiredstring
scoperequiredstring
secondPersonApprovedrequiredboolean
soleEditorboolean
statusrequiredstring
tagsrequiredarray of string
timeoutSecondsrequiredinteger
updatedAtrequiredstring (date-time)
versionrequiredinteger
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>/request-approval' \
-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.