Skip to content

/v2/background-scripts/
Stable

Request

Create a new background script

Bodyapplication/jsonrequired
namestring, [ 1 .. 50 ] charactersrequired

Name of the background script

scriptstringrequired

The script content to be executed on devices

interpreterstring, <= 50 characters

Interpreter used to run the script. Currently only 'powershell' is supported.

Default:"powershell"
always_runbooleanrequired

Whether the script runs continuously. When true, frequency_in_mins must be null.

frequency_in_minsinteger or null

Interval in minutes between script executions. Required when always_run is false, must be null when always_run is true.

timeout_in_minsinteger, >= 1

Maximum runtime in minutes before the script is terminated. Must be > 0. Defaults to 60 if omitted.

Default:60
descriptionstring or null, <= 300 characters

Optional description for the background script. Max 300 characters.

cURL
curl -i -X POST \
  https://api.esper.io/_mock/openapi/v2/background-scripts/ \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "script": "string",
    "interpreter": "powershell",
    "always_run": true,
    "frequency_in_mins": 0,
    "timeout_in_mins": 60,
    "description": "string"
  }'

Responses

Success

Bodyapplication/json
contentobject(blueprints_BackgroundScriptRead)
messagestring
codeinteger
Value:201
Response
{ "content": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "interpreter": "string", "always_run": true, "frequency_in_mins": 0, "timeout_in_mins": 0, "description": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "created_by": 0, "updated_by": 0 }, "message": "string", "code": 201 }