Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer . Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Body

application/json

Command execution request parameters

command
string
required

The command to run

Example:

"ls -la"

envs
object

The environment variables to run the command

Example:
workingDir
string

The working directory of the command. It not provided, the command will be run in the box.config.workingDir directory.

Example:

"/home/user/projects"

timeout
string
default:30s

The timeout of the command. If the command times out, the exit code will be 124. For example: 'timeout 5s sleep 10s' will result in exit code 124.

Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: "500ms", "30s", "5m", "1h" Default: 30s

Example:

"30s"

Response

200 - application/json

Result of command execution

exitCode
number
required

The exit code of the command

Example:

0

stdout
string
required

The standard output of the command

Example:

"total 16\ndrwxr-xr-x 4 user user 4096 Jan 15 10:30 .\ndrwxr-xr-x 3 user user 4096 Jan 15 10:25 .."

stderr
string
required

The standard error output of the command

Example:

""