Skip to content

Depot scriptschedules

Registers the schedule 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 schedules

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.
sortquerystring, one of created, lastFired, name, updatedNoSort key.
StatusBodyDescription
200application/json, PagedResultScriptScheduleViewSuccess.
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 ScriptScheduleView
items[].createdAtrequiredstring (date-time)
items[].cronExprrequiredstring
items[].enabledrequiredboolean
items[].graceSecondsrequiredinteger
items[].lastFiredAtstring (date-time) or null
items[].missedRunPolicyrequiredstring
items[].namerequiredstring
items[].nextDueAtstring (date-time) or null
items[].offlineCapablerequiredboolean
items[].paramValuesrequiredobject
items[].publicIdrequiredstring
items[].runAsrequiredstring
items[].scriptNamerequiredstring
items[].scriptPublicIdrequiredstring
items[].scriptVersionrequiredinteger
items[].targetrequiredTarget

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

items[].target.agentIdsarray of string
items[].target.groupIdsarray of string
items[].target.includeChildSitesboolean
items[].target.kindrequiredstring
items[].target.siteIdsarray of string
items[].timeoutSecondsrequiredinteger
items[].timezonerequiredstring
items[].triggerKindrequiredstring
items[].updatedAtrequiredstring (date-time)
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-schedules?dir=asc&page=0&pageSize=0&q=<q>&sort=created' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POSTscript:scheduletenant facehosteditmspremote

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

Source: [object Object]

Create script schedule

Required, sent as application/json.

FieldTypeDescription
cronExprstring or null
enabledboolean or null
graceSecondsinteger or null
missedRunPolicystring or null
namestring or null
offlineCapableboolean or null
paramValuesrequiredobject
runAsstring or null
scriptPublicIdstring or null
targetTarget

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
timeoutSecondsinteger or null
timezonestring or null
triggerKindstring or null
StatusBodyDescription
201application/json, ScriptScheduleViewCreated.
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 script:schedule.
404application/problem+json, ProblemDetailsSchedule not found.
409application/problem+json, ProblemDetailsA schedule with that name already exists.
422application/problem+json, ProblemDetailsThe request was refused.
500application/problem+json, ProblemDetailsNo client store in request context.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

201 response body

FieldTypeDescription
createdAtrequiredstring (date-time)
cronExprrequiredstring
enabledrequiredboolean
graceSecondsrequiredinteger
lastFiredAtstring (date-time) or null
missedRunPolicyrequiredstring
namerequiredstring
nextDueAtstring (date-time) or null
offlineCapablerequiredboolean
paramValuesrequiredobject
publicIdrequiredstring
runAsrequiredstring
scriptNamerequiredstring
scriptPublicIdrequiredstring
scriptVersionrequiredinteger
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
timezonerequiredstring
triggerKindrequiredstring
updatedAtrequiredstring (date-time)
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-schedules' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"cronExpr": "string",
"enabled": false,
"graceSeconds": 0,
"missedRunPolicy": "string",
"name": "string",
"offlineCapable": false,
"paramValues": {
"key": "string"
},
"runAs": "string",
"scriptPublicId": "string",
"target": {
"agentIds": [
"string"
],
"groupIds": [
"string"
],
"includeChildSites": false,
"kind": "string",
"siteIds": [
"string"
]
},
"timeoutSeconds": 0,
"timezone": "string",
"triggerKind": "string"
}'

GETscript:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

Get script schedule

NameInTypeRequiredDescription
scheduleIdpathstringYesA uuid.
StatusBodyDescription
200application/json, ScriptScheduleViewSuccess.
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
createdAtrequiredstring (date-time)
cronExprrequiredstring
enabledrequiredboolean
graceSecondsrequiredinteger
lastFiredAtstring (date-time) or null
missedRunPolicyrequiredstring
namerequiredstring
nextDueAtstring (date-time) or null
offlineCapablerequiredboolean
paramValuesrequiredobject
publicIdrequiredstring
runAsrequiredstring
scriptNamerequiredstring
scriptPublicIdrequiredstring
scriptVersionrequiredinteger
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
timezonerequiredstring
triggerKindrequiredstring
updatedAtrequiredstring (date-time)
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-schedules/<scheduleId>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

PUTscript:scheduletenant facehosteditmspremoteIdempotent

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

Source: [object Object]

Update script schedule

NameInTypeRequiredDescription
scheduleIdpathstringYesA uuid.

Required, sent as application/json.

FieldTypeDescription
cronExprstring or null
enabledboolean or null
graceSecondsinteger or null
missedRunPolicystring or null
namestring or null
offlineCapableboolean or null
paramValuesrequiredobject
runAsstring or null
scriptPublicIdstring or null
targetTarget

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
timeoutSecondsinteger or null
timezonestring or null
triggerKindstring or null
StatusBodyDescription
200application/json, ScriptScheduleViewSuccess.
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 script:schedule.
404application/problem+json, ProblemDetailsNo resource matches that id.
409application/problem+json, ProblemDetailsA schedule with that name already exists.
422application/problem+json, ProblemDetailsThe request was refused.
500application/problem+json, ProblemDetailsNo client store in request context.
503application/problem+json, ProblemDetailsThe script library is not available on this Depot.

200 response body

FieldTypeDescription
createdAtrequiredstring (date-time)
cronExprrequiredstring
enabledrequiredboolean
graceSecondsrequiredinteger
lastFiredAtstring (date-time) or null
missedRunPolicyrequiredstring
namerequiredstring
nextDueAtstring (date-time) or null
offlineCapablerequiredboolean
paramValuesrequiredobject
publicIdrequiredstring
runAsrequiredstring
scriptNamerequiredstring
scriptPublicIdrequiredstring
scriptVersionrequiredinteger
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
timezonerequiredstring
triggerKindrequiredstring
updatedAtrequiredstring (date-time)
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 PUT 'https://depot.example.com/api/v1/script-schedules/<scheduleId>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"cronExpr": "string",
"enabled": false,
"graceSeconds": 0,
"missedRunPolicy": "string",
"name": "string",
"offlineCapable": false,
"paramValues": {
"key": "string"
},
"runAs": "string",
"scriptPublicId": "string",
"target": {
"agentIds": [
"string"
],
"groupIds": [
"string"
],
"includeChildSites": false,
"kind": "string",
"siteIds": [
"string"
]
},
"timeoutSeconds": 0,
"timezone": "string",
"triggerKind": "string"
}'

DELETE /api/v1/script-schedules/{scheduleId}

Section titled “DELETE /api/v1/script-schedules/{scheduleId}”

DELETEscript:scheduletenant facehosteditmspremoteIdempotent

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

Source: [object Object]

Delete script schedule

NameInTypeRequiredDescription
scheduleIdpathstringYesA uuid.
StatusBodyDescription
204NoneSuccess, with no body.
401application/problem+json, ProblemDetailsNo signed-in identity.
403application/problem+json, ProblemDetailsThe identity does not hold script:schedule.
404application/problem+json, ProblemDetailsNo resource matches that id.
500application/problem+json, ProblemDetailsNo client store in request context.
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 DELETE 'https://depot.example.com/api/v1/script-schedules/<scheduleId>' \
-H 'X-CSRF-Token: <csrf-token>' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

GET /api/v1/script-schedules/{scheduleId}/runs

Section titled “GET /api/v1/script-schedules/{scheduleId}/runs”

GETscript:readtenant facehosteditmspremoteIdempotent

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

Source: [object Object]

List schedule runs

NameInTypeRequiredDescription
scheduleIdpathstringYesA uuid.
pagequeryintegerNoOne-based page number. Defaults to 1.
pageSizequeryintegerNoRows per page, 1 to 200. Defaults to 50.
statequerystringNo
StatusBodyDescription
200application/json, PagedResultScriptScheduleRunViewSuccess.
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
itemsrequiredarray of ScriptScheduleRunView
items[].agentIdrequiredstring
items[].commandIdrequiredstring
items[].completedAtstring (date-time) or null
items[].dueAtrequiredstring (date-time)
items[].exitCodeinteger or null
items[].firedAtstring (date-time) or null
items[].originrequiredstring
items[].publicIdrequiredstring
items[].reasonstring
items[].schedulePublicIdrequiredstring
items[].staterequiredstring
items[].usernamerequiredstring
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-schedules/<scheduleId>/runs?page=0&pageSize=0&state=<state>' \
-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.