POST /v1/sandboxes/{sandboxId}/cmd

Executes a shell command inside a running sandbox. The command runs asynchronously and returns immediately with a command ID that can be used to track its progress and retrieve its output. Optionally, use the wait parameter to stream the command status until completion.

Servers

Path parameters

Name Type Required Description
sandboxId String Yes

The unique identifier of the sandbox in which to execute the command.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
teamId String No

The Team identifier to perform the request on behalf of.

slug String No

The Team slug to perform the request on behalf of.

Request body fields

Name Type Required Description
env Object No

Additional environment variables to set for this command. These are merged with the sandbox environment.

cwd String No

The working directory in which to execute the command. Defaults to the sandbox home directory if not specified.

sudo Boolean No

Execute the command with root (superuser) privileges.

Default value: false

command String Yes

The executable or shell command to run. This is the program name without arguments.

wait Boolean No

If true, returns an ND-JSON stream that emits the command status when started and again when finished. Useful for synchronously waiting for command completion.

Default value: false

args[] Array No

Arguments to pass to the command. Each argument should be a separate array element.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.