Skip to content

computers.exec

POST
/v1/computers/{computerId}/sessions
curl --request POST \
--url https://example.com/v1/computers/example/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "command": "example", "cwd": "example", "env": { "additionalProperty": "example" }, "tty": true, "rows": 1, "cols": 1, "yieldTimeMs": 1, "maxOutputBytes": 1 }'

Starts a shell command and waits up to yieldTimeMs for it. When it still runs, the answer has a session ID for more input and output. A paused Computer resumes first.

computerId
required
string
>= 1 characters <= 128 characters
Media typeapplication/json
object
command
required
string
>= 1 characters <= 100000 characters
cwd
string
>= 1 characters <= 4096 characters
env
object
key
additional properties
string
tty
boolean
rows
integer
>= 1 <= 1000
cols
integer
>= 1 <= 1000
yieldTimeMs
integer
>= 250 <= 30000
maxOutputBytes
integer
>= 1 <= 1048576

Example generated

{
"command": "example",
"cwd": "example",
"env": {
"additionalProperty": "example"
},
"tty": true,
"rows": 1,
"cols": 1,
"yieldTimeMs": 1,
"maxOutputBytes": 1
}

Success

Media typeapplication/json
object
session
required
Any of:
string
>= 1 characters <= 128 characters
running
required
boolean
exitCode
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
signal
required
Any of:
string
output
required
string
truncated
required
boolean

Example generated

{
"session": "example",
"running": true,
"exitCode": 1,
"signal": "example",
"output": "example",
"truncated": true
}

ComputerInvalid | OrganizationRequired

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ComputerInvalid
message
required
string

Example

{
"_tag": "ComputerInvalid"
}

AuthenticationRequired

Media typeapplication/json
object
_tag
required
string
Allowed values: AuthenticationRequired

Example

{
"_tag": "AuthenticationRequired"
}

@nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: Forbidden
action
required
string
kind
required
string
field
string
reason
string

Example

{
"_tag": "Forbidden"
}

ComputerNotFound | ComputerPathNotFound | ComputerSessionNotFound | ComputerProviderNotFound | PairingInvalid

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ComputerNotFound
id
required
string

Example

{
"_tag": "ComputerNotFound"
}

@nmnmcc/ability/Authorizer/Pending | ComputerProviderInUse | ComputerConflict | ComputerUnsupported | ComputerNotReady

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: Pending
ticket
required
string
reason
string

Example

{
"_tag": "Pending"
}

RateLimited

Media typeapplication/json
object
_tag
required
string
Allowed values: RateLimited
retryAfterSeconds
required
integer
>= -9007199254740991 <= 9007199254740991

Example

{
"_tag": "RateLimited"
}

ComputerProviderFailed | ComputerExecutionFailed

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ComputerProviderFailed
message
required
string

Example

{
"_tag": "ComputerProviderFailed"
}

ComputersUnavailable | AuthenticationUnavailable | RequestFailed

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: PolicyUnavailable

Example

{
"_tag": "PolicyUnavailable"
}