Skip to content
Wardcase Docs

Run a command

POST
/v1/sandboxes/{id}/exec

With stream: false (default) the response is a single ExecResult once the command exits. With stream: true the response is application/x-ndjson, one ExecStreamEvent per line, ending with an exit event.

id
required
string
/^sbx_[A-Za-z0-9]+$/

Sandbox ids are lowercase: sbx_ followed by 16 characters from [a-z0-9]. Hostname labels derived from them are therefore safe to compare after lowercasing.

object
cmd
required
One of:

Run through /bin/sh -c

string
cwd
string
default: /work
env
object
key
additional properties
string
timeout_s
integer
default: 300 >= 1 <= 3600
pty
boolean
stream
boolean

Command finished, or stream of events

object
exec_id
required
string
exit_code
required
integer
stdout
required
string
stderr
required
string
duration_ms
required
integer
truncated
required

Output exceeded 10 MB and was cut

boolean
timed_out
boolean

Not found

RFC 9457 problem document

object
type
required

https://docs.wardcase.com/errors/<slug>. The slug is a stable machine code (PROBLEM_TYPES in @vivarium/contracts).

string format: uri
title
required
string
status
required
integer
detail
string
instance
string
errors

Field-level validation errors

Array<object>
object
path
required
string
message
required
string

The resource is not in a state that allows this

RFC 9457 problem document

object
type
required

https://docs.wardcase.com/errors/<slug>. The slug is a stable machine code (PROBLEM_TYPES in @vivarium/contracts).

string format: uri
title
required
string
status
required
integer
detail
string
instance
string
errors

Field-level validation errors

Array<object>
object
path
required
string
message
required
string

The host reported an error

RFC 9457 problem document

object
type
required

https://docs.wardcase.com/errors/<slug>. The slug is a stable machine code (PROBLEM_TYPES in @vivarium/contracts).

string format: uri
title
required
string
status
required
integer
detail
string
instance
string
errors

Field-level validation errors

Array<object>
object
path
required
string
message
required
string

The host did not answer within the deadline

RFC 9457 problem document

object
type
required

https://docs.wardcase.com/errors/<slug>. The slug is a stable machine code (PROBLEM_TYPES in @vivarium/contracts).

string format: uri
title
required
string
status
required
integer
detail
string
instance
string
errors

Field-level validation errors

Array<object>
object
path
required
string
message
required
string