Skip to main content
POST
Run a command

Authorizations

Authorization
string
header
required

workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at https://akua.dev/developers/api-tokens

Headers

akua-context
string

Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.

Required string length: 1 - 53
Example:

"ws_j572abc123def456"

Path Parameters

id
string
required

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$
Example:

"sbx_j572abc123def456"

Body

application/json
argv
string[]
required

Program and arguments, run without a shell.

Required array length: 1 - 256 elements
Maximum string length: 16384
cwd
string
default:/workspace

Absolute path inside the sandbox.

Required string length: 1 - 4096
Pattern: ^\/[^\0]*$
Example:

"/workspace/README.md"

env
object
timeout_seconds
integer
default:600

Seconds before the command is killed. Default 600.

Required range: 1 <= x <= 86400
wait
boolean
default:false

Return when the command finished, for at most 60 seconds, with its output. Otherwise return as soon as it started.

stdin
boolean
default:false

Keep standard input open for :writeStdin. Default false (empty input).

Response

Command started

id
string
required

Sandbox command id (cmd_...).

Pattern: ^cmd_[A-Za-z0-9]{1,64}$
Example:

"cmd_j572abc123def456"

sandbox_id
string
required

Sandbox id (sbx_...).

Pattern: ^sbx_[A-Za-z0-9]{1,64}$
Example:

"sbx_j572abc123def456"

argv
string[] | null
required
shell
string | null
required
cwd
string
required
timeout_seconds
integer
required
state
enum<string>
required

SUCCEEDED: exited with code 0. FAILED: exited with another code, was killed, or hit its timeout (exit code 124).

Available options:
RUNNING,
SUCCEEDED,
FAILED,
CANCELLED
exit_code
integer | null
required

Set once the command finished.

created_by
object
required
created_at
integer
required

Start time (Unix seconds).

Required range: x >= 0
finished_at
integer | null
required

Finish time (Unix seconds).

Required range: x >= 0
output
object | null
required

Captured output, only on the response to a wait: true request that finished in time; null elsewhere.